Skip to content

Commit 7e36fb5

Browse files
chrish42jreback
authored andcommitted
Improve error message for category dtype in HDF5, format="fixed" store.
A more explicit (and helpful) error message would have helped me discover sooner that format="table" supported categorical data. Author: Christian Hudon <[email protected]> Closes #13093 from chrish42/patch-1 and squashes the following commits: 9a6ef08 [Christian Hudon] Wrap line to be less than 80 characters. 8f436dc [Christian Hudon] Improve error message for category dtype in HDF5, format="fixed" store.
1 parent c5f4d9c commit 7e36fb5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/io/pytables.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -2517,7 +2517,9 @@ def write_array(self, key, value, items=None):
25172517
transposed = False
25182518

25192519
if com.is_categorical_dtype(value):
2520-
raise NotImplementedError("cannot store a category dtype")
2520+
raise NotImplementedError('Cannot store a category dtype in '
2521+
'a HDF5 dataset that uses format='
2522+
'"fixed". Use format="table".')
25212523

25222524
if not empty_array:
25232525
value = value.T

0 commit comments

Comments
 (0)