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] BooleanFilter doesn't work with np.array #13660

Closed
Fuuruko opened this issue Jan 23, 2024 · 0 comments · Fixed by #13661
Closed

[BUG] BooleanFilter doesn't work with np.array #13660

Fuuruko opened this issue Jan 23, 2024 · 0 comments · Fixed by #13661

Comments

@Fuuruko
Copy link

Fuuruko commented Jan 23, 2024

Software versions

Python version : 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)]
IPython version : 8.14.0
Tornado version : 6.3.3
Bokeh version : 3.3.3
BokehJS static path : C:\Users\xxx\AppData\Local\Programs\Python\Python311\Lib\site-packages\bokeh\server\static
node.js version : v20.11.0
npm version : 10.2.4
Operating system : Windows-10-10.0.19045-SP0

Browser name and version

No response

Jupyter notebook / Jupyter Lab version

No response

Expected behavior

Plot filtered data

Observed behavior

Doesn't plot anything

Example code

import numpy as np
from bokeh.models import CDSView, BooleanFilter
from bokeh.plotting import figure, show

x = np.array([1, 2, 3, 4, 5])

view = CDSView(filter=BooleanFilter(x < 4))

p = figure()
p.circle(x=x, y=x, size=10, view=view)

show(p)

Stack traceback or browser console output

Uncaught (in promise) Error: BooleanFilter(p1001).booleans given invalid value: {"0":1,"1":1,"2":1,"3":0,"4":0,"dtype":"bool","shape":[5],"dimension":1}
at N.validate (bokeh-3.3.3.min.js:183:2304)
at N._update (bokeh-3.3.3.min.js:183:2010)
at N.initialize (bokeh-3.3.3.min.js:183:1272)
at i.initialize_props (bokeh-3.3.3.min.js:179:4487)
at p._decode_object_ref (bokeh-3.3.3.min.js:212:4877)
at p._decode (bokeh-3.3.3.min.js:212:1779)
at p._decode_plain_object (bokeh-3.3.3.min.js:212:2340)
at p._decode (bokeh-3.3.3.min.js:212:1066)
at p._decode_object_ref (bokeh-3.3.3.min.js:212:4846)
at p._decode (bokeh-3.3.3.min.js:212:1779)

Screenshots

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants