From 85fe5e7814e10eb09d844fda6c49603013062e80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Wed, 28 Sep 2022 11:45:08 +0200 Subject: [PATCH] Revert "Raising DataError when passing int columns DataFrame to Dataset (#5354)" This reverts commit 7e3ec26b5274d13a0412bcb4477472dbbc471dc9. --- holoviews/core/data/pandas.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/holoviews/core/data/pandas.py b/holoviews/core/data/pandas.py index 430f5aadc6..e937ba39e7 100644 --- a/holoviews/core/data/pandas.py +++ b/holoviews/core/data/pandas.py @@ -55,9 +55,6 @@ def init(cls, eltype, data, kdims, vdims): elif kdims == [] and vdims is None: vdims = list(data.columns[:nvdim if nvdim else None]) - if any(isinstance(d, (np.int64, int)) for d in kdims+vdims): - raise DataError("pandas DataFrame column names used as dimensions " - "must be strings not integers.", cls) # Handle reset of index if kdims reference index by name for kd in kdims: kd = dimension_name(kd) @@ -67,6 +64,9 @@ def init(cls, eltype, data, kdims, vdims): for name in index_names): data = data.reset_index() break + if any(isinstance(d, (np.int64, int)) for d in kdims+vdims): + raise DataError("pandas DataFrame column names used as dimensions " + "must be strings not integers.", cls) if kdims: kdim = dimension_name(kdims[0])