Skip to content

Commit

Permalink
Bump bokeh minimum version to 3.1.0 (#8861)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbourbeau authored Sep 5, 2024
1 parent 50169e9 commit b28822b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 46 deletions.
2 changes: 1 addition & 1 deletion continuous_integration/recipes/dask/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ requirements:
- lz4 >=4.3.2
- numpy >=1.21
- pandas >=2
- bokeh >=2.4.2,!=3.0.*
- bokeh >=3.1.0
- jinja2 >=2.10.3
- pyarrow >=7.0

Expand Down
23 changes: 4 additions & 19 deletions distributed/dashboard/components/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
Range1d,
ResetTool,
Select,
TabPanel,
Tabs,
TapTool,
Title,
Expand Down Expand Up @@ -73,10 +74,8 @@
ProfileTimePlot,
SystemMonitor,
)
from distributed.dashboard.core import TabPanel
from distributed.dashboard.utils import (
_DATATABLE_STYLESHEETS_KWARGS,
BOKEH_VERSION,
PROFILING,
transpose,
update,
Expand Down Expand Up @@ -2271,18 +2270,8 @@ def __init__(self, scheduler, **kwargs):
self.edge_source = ColumnDataSource({"x": [], "y": [], "visible": []})

filter = GroupFilter(column_name="visible", group="True")
if BOKEH_VERSION.major < 3:
filter_kwargs = {"filters": [filter]}
else:
filter_kwargs = {"filter": filter}
node_view = CDSView(**filter_kwargs)
edge_view = CDSView(**filter_kwargs)

# Bokeh >= 3.0 automatically infers the source to use
if BOKEH_VERSION.major < 3:
node_view.source = self.node_source
edge_view.source = self.edge_source

node_view = CDSView(filter=filter)
edge_view = CDSView(filter=filter)
node_colors = factor_cmap(
"state",
factors=["waiting", "queued", "processing", "memory", "released", "erred"],
Expand Down Expand Up @@ -4515,10 +4504,6 @@ def update(self):
"box-shadow": "inset 1px 0 8px 0 lightgray",
"overflow": "auto",
}
if BOKEH_VERSION.major < 3:
_BOKEH_STYLES_KWARGS = {"style": _STYLES}
else:
_BOKEH_STYLES_KWARGS = {"styles": _STYLES}


class SchedulerLogs:
Expand All @@ -4538,7 +4523,7 @@ def __init__(self, scheduler, start=None):
)
)._repr_html_()

self.root = Div(text=logs_html, **_BOKEH_STYLES_KWARGS)
self.root = Div(text=logs_html, styles=_STYLES)


@log_errors
Expand Down
6 changes: 0 additions & 6 deletions distributed/dashboard/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@
)


if BOKEH_VERSION.major < 3:
from bokeh.models import Panel as TabPanel # noqa: F401
else:
from bokeh.models import TabPanel # noqa: F401


if BOKEH_VERSION < parse_version("3.3.0"):
from bokeh.server.server import BokehTornado as DaskBokehTornado
else:
Expand Down
21 changes: 9 additions & 12 deletions distributed/dashboard/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,15 @@

PROFILING = False

if BOKEH_VERSION.major < 3:
_DATATABLE_STYLESHEETS_KWARGS = {}
else:
_DATATABLE_STYLESHEETS_KWARGS = {
"stylesheets": [
"""
.bk-data-table {
z-index: 0;
}
"""
]
}
_DATATABLE_STYLESHEETS_KWARGS = {
"stylesheets": [
"""
.bk-data-table {
z-index: 0;
}
"""
]
}


def transpose(lod):
Expand Down
10 changes: 3 additions & 7 deletions distributed/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -8421,17 +8421,13 @@ def profile_to_figure(state):
sysmon.update()

# Scheduler logs
from distributed.dashboard.components.scheduler import (
_BOKEH_STYLES_KWARGS,
SchedulerLogs,
)
from distributed.dashboard.components.scheduler import _STYLES, SchedulerLogs

logs = SchedulerLogs(self, start=start)

from bokeh.models import Div, Tabs
from bokeh.models import Div, TabPanel, Tabs

import distributed
from distributed.dashboard.core import TabPanel

# HTML
html = """
Expand Down Expand Up @@ -8472,7 +8468,7 @@ def profile_to_figure(state):
dask_version=dask.__version__,
distributed_version=distributed.__version__,
)
html = Div(text=html, **_BOKEH_STYLES_KWARGS)
html = Div(text=html, styles=_STYLES)

html = TabPanel(child=html, title="Summary")
compute = TabPanel(child=compute, title="Worker Profile (compute)")
Expand Down
2 changes: 1 addition & 1 deletion distributed/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from packaging.requirements import Requirement

BOKEH_REQUIREMENT = Requirement("bokeh>=2.4.2,!=3.0.*")
BOKEH_REQUIREMENT = Requirement("bokeh>=3.1.0")

required_packages = [
("dask", lambda p: p.__version__),
Expand Down

0 comments on commit b28822b

Please sign in to comment.