Skip to content

Conversation

emilykl
Copy link
Contributor

@emilykl emilykl commented Jun 30, 2025

Closes #5257

Reverts change to plotly/io/_renderers.py added in #5096 to keep the original logic flow of the if statement.

Adds a test to ensure that the default renderer is "browser" while running the tests; since the test_optional workflow installs jupyter which installs ipython, this should prevent a regression.

Steps to test

  1. Verify incorrect behavior on main:
    • pip install jupyter
    • Run python -c "import plotly.express as px; fig = px.scatter(x=[1], y=[1]); fig.show()". This SHOULD show a figure in the browser, but instead it prints the HTML/JS to the terminal output.
  2. Verify correct behavior on this branch:
    • Run python -c "import plotly.express as px; fig = px.scatter(x=[1], y=[1]); fig.show()" and make sure the figure is shown in the browser
  3. Make sure figure still renders correctly in Jupyter notebook:
    • This is a little tricky because Jupyter rendering seems to not play nicely with the local install (at least on my machine) and I'm not sure why yet. But it's not a problem introduced by this PR; the same is true on main.
    • For that reason I recommend downloading the build artifacts from the CI and installing the built wheel.
    • Run jupyter notebook to launch the notebook editor, and create a new notebook
    • Make sure the following code correctly renders a figure in the notebook:
import plotly.express as px
fig = px.scatter(x=[1], y=[1])
fig.show()

Copy link
Collaborator

@marthacryan marthacryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gvwilson gvwilson added P1 needed for current cycle fix fixes something broken labels Jul 3, 2025
@camdecoster
Copy link
Contributor

I followed the test steps above and everything worked correctly (including the Jupyter notebook with a local package).

@emilykl emilykl merged commit d2af541 into main Oct 1, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix fixes something broken P1 needed for current cycle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default renderer is incorrect when ipython is installed in environment
4 participants