-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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] range no longer works with ColumnDataSource #12313
Comments
The are a few issues here. First, the error should be: bokeh.core.serialization.SerializationError: can't serialize <class 'range'> That's an obvious bug. I assumed Second, serialization of iterators as arrays is a bad idea (this was done in 2.4). If anything, iterators have to be serialized as objects that can be deserialized to iterators (back and forth), but that's equivalent to serialization of functions in the most generic setup. Thus, if we want to keep iterator support in APIs like |
It seems to be missing because it is initialized: >>> range.__module__
'builtins'
>>> range(10).__module__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'range' object has no attribute '__module__'
>>> type(range(10)).__module__
'builtins' |
Sure, the problem is that this is different behavior from user defined types: n [1]: class Foo:
...: pass
...:
In [2]: o = Foo()
In [3]: o.__module__
Out[3]: '__main__'
In [4]: type(o).__module__
Out[4]: '__main__'
In [5]: Foo.__module__
Out[5]: '__main__'
In [6]: r = range(10)
In [7]: r.__module__
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Input In [7], in <cell line: 1>()
----> 1 r.__module__
AttributeError: 'range' object has no attribute '__module__'
In [8]: type(r).__module__
Out[8]: 'builtins'
In [9]: range.__module__
Out[9]: 'builtins' |
Software versions
Browser name and version
No response
Jupyter notebook / Jupyter Lab version
No response
Expected behavior
The code should be able to run, or a better error message is needed.
Observed behavior
The example code does not run on bokeh 3.0, it works on version 2.4.3.
Example code
Stack traceback or browser console output
Screenshots
No response
The text was updated successfully, but these errors were encountered: