Skip to content

Commit

Permalink
Add version check for absolute url fix (dask#8381)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtomlinson authored Dec 1, 2023
1 parent 6d1e133 commit 051f82a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions distributed/dashboard/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from bokeh.application import Application
from bokeh.application.handlers.function import FunctionHandler
from bokeh.resources import Resources
from bokeh.server.server import BokehTornado
from bokeh.server.util import create_hosts_allowlist
from packaging.version import parse as parse_version

import dask

Expand All @@ -32,9 +32,14 @@
from bokeh.models import TabPanel # noqa: F401


class DaskBokehTornado(BokehTornado):
def resources(self, absolute_url: str | bool | None = True) -> Resources:
return super().resources(absolute_url)
if BOKEH_VERSION < parse_version("3.3.0"):
from bokeh.server.server import BokehTornado as DaskBokehTornado
else:
from bokeh.server.server import BokehTornado

class DaskBokehTornado(BokehTornado): # type: ignore[no-redef]
def resources(self, absolute_url: str | bool | None = True) -> Resources:
return super().resources(absolute_url)


def BokehApplication(applications, server, prefix="/", template_variables=None):
Expand Down

0 comments on commit 051f82a

Please sign in to comment.