|
21 | 21 | import pytest |
22 | 22 |
|
23 | 23 | from pyiceberg.conversions import to_bytes |
| 24 | +from pyiceberg.partitioning import PartitionField, PartitionSpec |
24 | 25 | from pyiceberg.schema import Schema |
25 | 26 | from pyiceberg.table.inspect import _readable_bound |
| 27 | +from pyiceberg.transforms import IdentityTransform |
26 | 28 | from pyiceberg.types import NestedField, StringType |
27 | 29 | from tests.catalog.test_base import InMemoryCatalog |
28 | 30 |
|
@@ -68,3 +70,14 @@ def test_inspect_entries_and_files_render_null_bound(catalog: InMemoryCatalog) - |
68 | 70 | files_metrics = tbl.inspect.files().to_pydict()["readable_metrics"][0]["s"] |
69 | 71 | assert files_metrics["lower_bound"] is None |
70 | 72 | assert files_metrics["upper_bound"] is None |
| 73 | + |
| 74 | + |
| 75 | +def test_inspect_manifests_preserves_empty_string_bounds(catalog: InMemoryCatalog) -> None: |
| 76 | + schema = Schema(NestedField(1, "s", StringType())) |
| 77 | + spec = PartitionSpec(PartitionField(1, 1000, IdentityTransform(), "s")) |
| 78 | + tbl = catalog.create_table("default.empty_string_partition", schema, partition_spec=spec) |
| 79 | + tbl.append(pa.table({"s": [""]}, schema=pa.schema([pa.field("s", pa.large_string())]))) |
| 80 | + |
| 81 | + partition_summary = tbl.inspect.manifests().to_pydict()["partition_summaries"][0][0] |
| 82 | + assert partition_summary["lower_bound"] == "" |
| 83 | + assert partition_summary["upper_bound"] == "" |
0 commit comments