(use_batch)
| 138 | |
| 139 | @pytest.mark.parametrize("use_batch", [False, True]) |
| 140 | def test_categorical(use_batch): |
| 141 | import pyarrow as pa |
| 142 | arr = ["Mon", "Tue", "Mon", "Wed", "Mon", "Thu", "Fri", "Sat", None] |
| 143 | table = pa.table( |
| 144 | {"weekday": pa.array(arr).dictionary_encode()} |
| 145 | ) |
| 146 | if use_batch: |
| 147 | table = table.to_batches()[0] |
| 148 | |
| 149 | col = table.__dataframe__().get_column_by_name("weekday") |
| 150 | categorical = col.describe_categorical |
| 151 | assert isinstance(categorical["is_ordered"], bool) |
| 152 | assert isinstance(categorical["is_dictionary"], bool) |
| 153 | |
| 154 | |
| 155 | @pytest.mark.parametrize("use_batch", [False, True]) |
nothing calls this directly
no test coverage detected