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

[BUG] export_png broken in Bokeh 1.3.0 #9123

Closed
cyrilpic opened this issue Jul 29, 2019 · 13 comments

Comments

@cyrilpic
Copy link

commented Jul 29, 2019

I have been using export_png (and export_svgs) a lot lately and everything worked like a charm until I updated to Bokeh 1.3.0.

Running the following example returns these errors:

import numpy as np

import bokeh.plotting as bp
from bokeh.io import export_png

x = np.linspace(0, 2)
y = np.sqrt(x)

fig = bp.figure(width=700, height=300)
fig.circle(x, y)

export_png(fig, "test.png")
WARNING:bokeh.io.export:There were browser warnings and/or errors that may have affected your export
WARNING:bokeh.io.export:ReferenceError: Can't find variable: Set
  render (file:////var/folders/q4/k76wvxk94bxcttrrr5x_85wm0000gn/T/bokehbmfq_0bl.html:51)
  _paint_levels (file:////var/folders/q4/k76wvxk94bxcttrrr5x_85wm0000gn/T/bokehbmfq_0bl.html:51)
  paint (file:////var/folders/q4/k76wvxk94bxcttrrr5x_85wm0000gn/T/bokehbmfq_0bl.html:51)
  after_layout (file:////var/folders/q4/k76wvxk94bxcttrrr5x_85wm0000gn/T/bokehbmfq_0bl.html:51)
  compute_layout (file:////var/folders/q4/k76wvxk94bxcttrrr5x_85wm0000gn/T/bokehbmfq_0bl.html:51)
  build (file:////var/folders/q4/k76wvxk94bxcttrrr5x_85wm0000gn/T/bokehbmfq_0bl.html:51)
  renderTo (file:////var/folders/q4/k76wvxk94bxcttrrr5x_85wm0000gn/T/bokehbmfq_0bl.html:51)
  c (file:////var/folders/q4/k76wvxk94bxcttrrr5x_85wm0000gn/T/bokehbmfq_0bl.html:51)
  add_document_standalone (file:////var/folders/q4/k76wvxk94bxcttrrr5x_85wm0000gn/T/bokehbmfq_0bl.html:51)
  f (file:////var/folders/q4/k76wvxk94bxcttrrr5x_85wm0000gn/T/bokehbmfq_0bl.html:51)
  (anonymous function) (file:////var/folders/q4/k76wvxk94bxcttrrr5x_85wm0000gn/T/bokehbmfq_0bl.html:51)

The generate image contains the grid but is empty otherwise. Under 1.2.0, everything is working fine and we get the expect points in the PNG.

This is possibly related to #7510. "Set" is apparently not defined in phantomJS. The tests are not failing because the tests are using Chrome. If Chrome is required, shouldn't it be the default driver (currently to my understanding it's still phantomJS) ?

Software version

  • python 3.6.8 (conda)
  • bokeh 1.3.0
  • selenium 3.141.0
  • phantomJS 2.1.1
  • macOS 10.14.6

@cyrilpic cyrilpic added the TRIAGE label Jul 29, 2019

@bryevdv

This comment has been minimized.

Copy link
Member

commented Jul 29, 2019

@bryevdv

This comment has been minimized.

Copy link
Member

commented Jul 29, 2019

I've already started tagging 1.4 dev builds but I think we should delete those tags and make a 1.3.1 to address this.

We need to figure out why the tests are not exposing this as well.

If Chrome is required

Chroms is not (should not be) required

@bryevdv

This comment has been minimized.

Copy link
Member

commented Jul 29, 2019

I think the reason the tests did not catch this is that they test minimal output with empty plots. But this bug actually produces just that, in all cases. The tests will need to be more thorough and actually add real renderers.

@cyrilpic

This comment has been minimized.

Copy link
Author

commented Jul 29, 2019

I tried to hack the WebDriver setup to have it use chrome (in bokeh.io.webdriver) and it does render the dots (but I guess my chrome options are not correct because the image is not correctly cropped). It would kind of confirm that some new javascript code cannot be interpreted by phantomJS.

Just in case, here are the plots:

with v1.2.0
test-1 2 0

v1.3.0 phantomjs
test-1 3 0

v1.3.0 chrome ("hack")
test-1 3 0-chrome

@mattpap

This comment has been minimized.

Copy link
Contributor

commented Jul 29, 2019

Native Set is being used since PR #9034. Unfortunately phantomjs doesn't appear on any compatibility listings, so it's easy to introduce a regression like this. On a side note, that PR also may have broken IE as well, because although IE supports Set, it doesn't allow to initialize it from an iterable (which is being used by that PR). The simplest fix will be to add a polyfill for Set. I will submit a PR later today.

@bryevdv

This comment has been minimized.

Copy link
Member

commented Jul 29, 2019

BTW I know folks are very "PhantomJS is deprecated, Chrome should be the default" but the trade-offs are not insignificant. Last time I checked, using Chrome was nearly 5x slower than using PhantomJS (which is already slow). I still support bolstering the tests and leaving the default as PhantomJS for now, pending more research.

@bryevdv

This comment has been minimized.

Copy link
Member

commented Jul 29, 2019

OK I have deleted all the 1.4 dev tags and assets, we should be able to have 1.3.1 release. I will cut a 1.3.1 dev build just to check the machinery.

@bryevdv

This comment has been minimized.

Copy link
Member

commented Jul 29, 2019

OK things are ready but conda is now exploding, and confirmed it happens on an old successful build that is restarted so I think it is unrelated

@bryevdv

This comment has been minimized.

Copy link
Member

commented Jul 29, 2019

I think the conda issue is sorted, and 1.3.1dev2 released. So we should be good to cut 1.3.1 with a hotfix for this ASAP. Woudl really like to have the tests marginally improved (e.g. render a single circle or something)

@bryevdv

This comment has been minimized.

Copy link
Member

commented Jul 29, 2019

@mattpap "minimal" tests on master are currently failing. The new conda version is more aggressive at removing packages that were never explicitly installed, so ipython is getting removed where it was not before, causing some tests to fail. I will push a PR to fix tonight.

@bryevdv bryevdv modified the milestones: 1.4, 1.3.1 Jul 29, 2019

@bryevdv

This comment has been minimized.

Copy link
Member

commented Jul 30, 2019

Thank you @cyrilpic for raising this issue

@bryevdv

This comment has been minimized.

Copy link
Member

commented Jul 30, 2019

1.3.1 is released with a fix

@cyrilpic

This comment has been minimized.

Copy link
Author

commented Jul 30, 2019

Thank you for this super fast fix and your amazing work on bokeh!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.