| 934 | |
| 935 | |
| 936 | def test_partition_keys(): |
| 937 | a, b, c = [ds.field(f) == f for f in 'abc'] |
| 938 | assert ds.get_partition_keys(a) == {'a': 'a'} |
| 939 | assert ds.get_partition_keys(a) == ds._get_partition_keys(a) |
| 940 | assert ds.get_partition_keys(a & b & c) == {f: f for f in 'abc'} |
| 941 | |
| 942 | nope = ds.field('d') >= 3 |
| 943 | assert ds.get_partition_keys(nope) == {} |
| 944 | assert ds.get_partition_keys(a & nope) == {'a': 'a'} |
| 945 | |
| 946 | null = ds.field('a').is_null() |
| 947 | assert ds.get_partition_keys(null) == {'a': None} |
| 948 | |
| 949 | |
| 950 | @pytest.mark.parquet |