Skip to content

Commit 220bbe6

Browse files
authored
fix: Check categorical legend dtypes for categories before accessing it (#6053)
1 parent c83ddae commit 220bbe6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

holoviews/plotting/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ def _process(self, element, key=None):
13761376
if not isinstance(agg, (ds.count_cat, ds.by)):
13771377
return
13781378
column = agg.column
1379-
if hasattr(hvds.data, 'dtypes'):
1379+
if hasattr(hvds.data, 'dtypes') and hasattr(hvds.data.dtypes[column], 'categories'):
13801380
try:
13811381
cats = list(hvds.data.dtypes[column].categories)
13821382
except TypeError:

0 commit comments

Comments
 (0)