Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions tests/_plugins/ui/_impl/tables/test_polars_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,18 +983,15 @@ def test_to_json_binary(self) -> None:

data.write_json()

def test_to_json_enum_list_not_supported(self) -> None:
# When this is supported, we can remove the casting to string
def test_to_json_enum_list_supported(self) -> None:
import polars as pl

data = {"A": [["A", "B", "C"], ["A", "B", "C"], ["A", "B", "C"]]}

data_enum = pl.DataFrame(
data, schema={"A": pl.List(pl.Enum(categories=["A", "B", "C"]))}
)
with pytest.raises(pl.exceptions.PanicException):
data_enum.write_json()
data_enum.write_json()

data_list = pl.DataFrame(data, schema={"A": pl.List(pl.Categorical())})
with pytest.raises(pl.exceptions.PanicException):
data_list.write_json()
data_list.write_json()
Loading