Skip to content

Commit

Permalink
fix(polars): handle new categorical types
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Dec 18, 2023
1 parent 28f76b8 commit 5d6d6ae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ibis/backends/polars/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
_from_polars_types = {v: k for k, v in _to_polars_types.items()}
_from_polars_types[pl.Categorical] = dt.String

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


@functools.singledispatch
def dtype_to_polars(dtype):
Expand Down

0 comments on commit 5d6d6ae

Please sign in to comment.