Support Bokeh 2.1
The create_hosts_whitelist function was renamed to create_hosts_allowlist
Fixes
@@ -4,7 +4,11 @@ import warnings
import bokeh
from bokeh.server.server import BokehTornado
-from bokeh.server.util import create_hosts_whitelist
+
+try:
+ from bokeh.server.util import create_hosts_allowlist
+except ImportError:
+ from bokeh.server.util import create_hosts_whitelist as create_hosts_allowlist
from bokeh.application.handlers.function import FunctionHandler
from bokeh.application import Application
import dask
@@ -30,7 +34,7 @@ def BokehApplication(applications, server, prefix="/", template_variables={}):
apps = {k: functools.partial(v, server, extra) for k, v in applications.items()}
apps = {k: Application(FunctionHandler(v)) for k, v in apps.items()}
kwargs = dask.config.get("distributed.scheduler.dashboard.bokeh-application").copy()
- extra_websocket_origins = create_hosts_whitelist(
+ extra_websocket_origins = create_hosts_allowlist(
kwargs.pop("allow_websocket_origin"), server.http_server.port
)
