Skip to content

Commit 5d6d6ae

Browse files
committed
fix(polars): handle new categorical types
1 parent 28f76b8 commit 5d6d6ae

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ibis/backends/polars/datatypes.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
_from_polars_types = {v: k for k, v in _to_polars_types.items()}
3030
_from_polars_types[pl.Categorical] = dt.String
3131

32+
# `physical` and `lexical` were introduced in polars 0.20, but the constructor
33+
# always accepted any string here
34+
_from_polars_types[pl.Categorical(ordering="physical")] = dt.String
35+
_from_polars_types[pl.Categorical(ordering="lexical")] = dt.String
36+
3237

3338
@functools.singledispatch
3439
def dtype_to_polars(dtype):

0 commit comments

Comments
 (0)