Repository navigation
Closed
Description
I think I've seen other reports of this recently, but here's an example of the bokeh dashboard being sad:
from dask.distributed import Client
client = Client()
import zarr
import numpy as np
import dask.array as da
n = (100000, 100000)
chunksize = (5000, 5000)
input = zarr.ones(n, chunks=chunksize)
def f1d(chunk):
return chunk.sum(keepdims=True)
def f2d(chunk, axis=None):
return chunk.sum(axis=axis, keepdims=True)
x = da.from_array(input, chunks=chunksize)
a = x.map_blocks(f1d)
b = x.map_blocks(f2d, axis=0)
c = x.map_blocks(f2d, axis=1)
import dask
aa, bb, cc = dask.persist(a, b, c)BokehUserWarning: ColumnDataSource's columns must be of the same length. Current lengths: ('alpha', 519), ('color', 481), ('duration', 519), ('duration_text', 481), ('key', 481), ('name', 481), ('start', 519), ('worker', 481), ('worker_thread', 481), ('y', 519)
BokehUserWarning: ColumnDataSource's columns must be of the same length. Current lengths: ('alpha', 555), ('color', 483), ('duration', 555), ('duration_text', 483), ('key', 483), ('name', 483), ('start', 555), ('worker', 483), ('worker_thread', 483), ('y', 555)
BokehUserWarning: ColumnDataSource's columns must be of the same length. Current lengths: ('alpha', 582), ('color', 490), ('duration', 582), ('duration_text', 490), ('key', 490), ('name', 490), ('start', 582), ('worker', 490), ('worker_thread', 490), ('y', 582)
BokehUserWarning: ColumnDataSource's columns must be of the same length. Current lengths: ('alpha', 614), ('color', 478), ('duration', 614), ('duration_text', 478), ('key', 478), ('name', 478), ('start', 614), ('worker', 478), ('worker_thread', 478), ('y', 614)
BokehUserWarning: ColumnDataSource's columns must be of the same length. Current lengths: ('alpha', 644), ('color', 492), ('duration', 644), ('duration_text', 492), ('key', 492), ('name', 492), ('start', 644), ('worker', 492), ('worker_thread', 492), ('y', 644)
BokehUserWarning: ColumnDataSource's columns must be of the same length. Current lengths: ('alpha', 672), ('color', 480), ('duration', 672), ('duration_text', 480), ('key', 480), ('name', 480), ('start', 672), ('worker', 480), ('worker_thread', 480), ('y', 672)
BokehUserWarning: ColumnDataSource's columns must be of the same length. Current lengths: ('alpha', 700), ('color', 492), ('duration', 700), ('duration_text', 492), ('key', 492), ('name', 492), ('start', 700), ('worker', 492), ('worker_thread', 492), ('y', 700)Sorry for the not entirely minimal example. Hopefully it's easy to reproduce though.
Reacted by Deepak Cherian, Mattia Almansi, Ayush Dattagupta and Dave McKay
Activity
quasiben commentedon Aug 8, 2023
I think there was a change between bokeh 3.2.0 and 3.2.1 . FWIW I like @jacobtomlinson 's poke code for testing the dashboard. @bryevdv, if you have any time, do you know what may have changed relating to
ColumnDataSourceor anything related to the above warnings ?bryevdv commentedon Aug 8, 2023
That message indicates a usage error. Creating a CDS with different column lengths has never been supported, but I think a hard error was only added recently (previously you'd just get silent failures / undefined behavior). I don't think that check went in with 3.2.1 though (very little went into 3.2.1 -- https://github.com/bokeh/bokeh/milestone/82?closed=1).
If you need to update a CDS with new data that has a different length, then you need to update the entire
.dataat once:v2thegreat commentedon Aug 8, 2023
Hi, I'm running into the issue right now. Would it make sense to downgrade to 3.2.0 and wait it out? It's making using Dask difficult.
Edit: I tried that and it seems to have hidden away the issue for now
quasiben commentedon Aug 8, 2023
Yes, I would recommend downgrading to 3.2.0 until we get this sorted out
bryevdv commentedon Aug 8, 2023
The only remotely possibly relevant change I can see in
3.2.0...3.2.1was this small bugfix for streaming for therollover=0case:PropertyValueColumnData._stream()to handlerollover=0bokeh/bokeh#13239Is the dashboard using
stream? Can someone point me at that code if so? Is it possible you are not streaming all the columns? (Though doing that should always have resulted in an error 🤷 ) Looking at the PR again, it still looks correct and notably no existing tests were modified, only new tests forrollover=0were added.bryevdv commentedon Aug 8, 2023
In any case the quickest test someone who can reproduce could perform, to see if the above change has any bearing, would be to install 3.2.1 but manually copy over the
src/bokeh/core/property/wrappers.pyfile from 3.2.0.quasiben commentedon Aug 9, 2023
Apologies for the delay. It is a
streamuse case:distributed/distributed/dashboard/components/scheduler.py
Lines 2149 to 2154 in de86523
As you suggested I pulled the 3.2.0 wrappers.py file and that indeed did resolve the warnings from popping up
quasiben commentedon Aug 9, 2023
After exploring a bit more I think this is happening when rollover is larger than the array. In the dask case,
Lin wrappers.py will be 504 and rollover is 1000. So there is a substantive difference betweendel L[:-rollover]anddel L[:len(L) - rollover]. I'm not exactly clear on what is happening on the bokeh side but would it be correct to say that if rollover > len(L) do nothing ?bryevdv commentedon Aug 9, 2023
Yes that seems like a new bug. The latest PR fixed one missing corner (0) case but broke another (>N). Let me see if the PR author can submit a patch to get in a 3.2.2 release soon.
jrbourbeau commentedon Aug 9, 2023
Thanks @quasiben @bryevdv!
bryevdv commentedon Aug 9, 2023
Fix PR is verified and merged. I will try to backport and cut a 3.2.2 release in the next few days
graelo commentedon Aug 11, 2023
@bryevdv this works great on 3.3, thanks a ton! Looking forward to a release ;)
bryevdv commentedon Aug 11, 2023
👍 Should be Monday
bryevdv commentedon Aug 14, 2023
3.2.2 is available on PyPI and the Bokeh
anaconda.orgchannel. I am not plugged into the process for availability on conda-forge and defaults these days.quasiben commentedon Aug 14, 2023
Thanks @bryevdv for all the help! Confirmed 3.2.2 works. Since this is a warning I don't think it's worth the trouble excluding bokeh 3.2.1 from installing with Distributed though if others feel differently please say so. Closing
jrbourbeau commentedon Aug 14, 2023
That sounds good to me @quasiben. Thanks again for fixing / releasing @bryevdv