From b4c65ffa1ce4251244948584dbc5febd56da13ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sun, 15 Oct 2023 15:32:32 +0200 Subject: [PATCH] Add supression inside loop for dtype_fix_hook --- holoviews/plotting/bokeh/util.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/holoviews/plotting/bokeh/util.py b/holoviews/plotting/bokeh/util.py index 6ba380ac28..6a74570dc7 100644 --- a/holoviews/plotting/bokeh/util.py +++ b/holoviews/plotting/bokeh/util.py @@ -4,7 +4,7 @@ import re import time from collections import defaultdict -from contextlib import contextmanager +from contextlib import contextmanager, suppress from itertools import permutations from types import FunctionType @@ -1192,14 +1192,15 @@ def dtype_fix_hook(plot, element): # Work-around for problems seen in: # https://github.com/holoviz/holoviews/issues/5722 # https://github.com/holoviz/holoviews/issues/5726 - # Should be fixed in Bokeh 3.2 + # https://github.com/holoviz/holoviews/issues/5941 + # Should be fixed in Bokeh: + # https://github.com/bokeh/bokeh/issues/13155 - try: + with suppress(Exception): renderers = plot.handles["plot"].renderers for renderer in renderers: - data = renderer.data_source.data - for k, v in data.items(): - if hasattr(v, "dtype") and v.dtype.kind == "U": - data[k] = v.tolist() - except Exception: - pass + with suppress(Exception): + data = renderer.data_source.data + for k, v in data.items(): + if hasattr(v, "dtype") and v.dtype.kind == "U": + data[k] = v.tolist()