Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes graphs don't show when using Jupyter notebook #322

Closed
amontanez24 opened this issue Mar 13, 2023 · 3 comments · Fixed by #497
Closed

Sometimes graphs don't show when using Jupyter notebook #322

amontanez24 opened this issue Mar 13, 2023 · 3 comments · Fixed by #497
Assignees
Labels
bug Something isn't working
Milestone

Comments

@amontanez24
Copy link
Contributor

Environment Details

Please indicate the following details about the environment in which you found the bug:

  • SDMetrics version: 0.9.2
  • Python version: 3.9
  • Operating System: MacOs

Error Description

When running get_visualization in jupyter notebook, the graph doesn't show up. Sometimes restarting the kernel, clearing the output and rerunning helps.

Steps to reproduce

quality_report = QualityReport()
quality_report.generate(
    input_data,
    output_data,
    metadata
)
quality_report.get_visualization('Column Shapes', table_name='agents')
@amontanez24 amontanez24 added the bug Something isn't working label Mar 13, 2023
@awsxcrd
Copy link

awsxcrd commented Mar 17, 2023

Hi, have you solved the problem? I have the same bug on windows, can you give me some suggestions?

@npatki
Copy link
Contributor

npatki commented Mar 17, 2023

Hi @amontanez24 and @awsxcrd I was able to replicate this problem.

Workaround: The plots are showing pretty consistently if I add the following lines to the top of my notebook:

from plotly.offline import init_notebook_mode

init_notebook_mode(connected=True)

Let me know if that resolves the issue for you. If so, we can think about making this more seamless inside of SDMetrics itself.

More context: We use Plotly as our graphing library for SDMetrics. Some searches on the Plotly community forum led me to this conversation.

@npatki npatki added the under discussion Issue is currently being discussed label Mar 17, 2023
@amontanez24
Copy link
Contributor Author

Writing

import plotly.io as pio
pio.renderers.default='iframe'

before running any visualization commands seemed to work for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants