JDASoftwareGroup / kartothek

A consistent table management library in python
https://kartothek.readthedocs.io/en/stable
MIT License
161 stars 53 forks source link

Raising warning for too many categorical values raises Exception #501

Closed steffen-schroeder-by closed 2 years ago

steffen-schroeder-by commented 2 years ago

The coding below fails https://github.com/JDASoftwareGroup/kartothek/blob/89ef9d21496530f282784d3cd8d16ddafa53f139/kartothek/io/dask/_utils.py#L53-L57 with

File "/foo/kartothek/io/dask/_utils.py"  line 53   in _construct_categorical 
   warnings.warn("TypeError: category must be a Warning subclass, not 'str'")

This is because the signature is warnings.warn(message, category=None, stacklevel=1, source=None) while column is a string. (docs)