Skip to content

Commit 5fff0eb

Browse files
author
Sean Sullivan
committed
Fix datashader 0.15.0 single category bug
1 parent 810f662 commit 5fff0eb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

elastic_datashader/tilegen.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,6 +1271,10 @@ def remap_bucket(bucket, search):
12711271
categories.insert(0, categories.pop(categories.index("Other")))
12721272
except ValueError:
12731273
pass
1274+
1275+
# datashader has issue in 0.15.0 with categories that have only one class
1276+
if len(categories) == 1:
1277+
categories.append('')
12741278
cat_dtype = pd.api.types.CategoricalDtype(categories=categories, ordered=True)
12751279
df["t"] = df["t"].astype(cat_dtype)
12761280

0 commit comments

Comments
 (0)