|
23 | 23 |
|
24 | 24 | from pyiceberg.conversions import to_bytes |
25 | 25 | from pyiceberg.manifest import DataFile, DataFileContent |
| 26 | +from pyiceberg.partitioning import PartitionField, PartitionSpec |
26 | 27 | from pyiceberg.schema import Schema |
27 | 28 | from pyiceberg.table.inspect import InspectTable, _readable_bound |
28 | 29 | from pyiceberg.table.snapshots import Snapshot |
| 30 | +from pyiceberg.transforms import IdentityTransform |
29 | 31 | from pyiceberg.typedef import Record |
30 | 32 | from pyiceberg.types import NestedField, StringType |
31 | 33 | from tests.catalog.test_base import InMemoryCatalog |
@@ -93,3 +95,14 @@ def test_partitions_last_updated_uses_latest_snapshot_regardless_of_order(newest |
93 | 95 | (partition_row,) = partitions_map.values() |
94 | 96 | assert partition_row["last_updated_at"] == newer.timestamp_ms |
95 | 97 | assert partition_row["last_updated_snapshot_id"] == newer.snapshot_id |
| 98 | + |
| 99 | + |
| 100 | +def test_inspect_manifests_preserves_empty_string_bounds(catalog: InMemoryCatalog) -> None: |
| 101 | + schema = Schema(NestedField(1, "s", StringType())) |
| 102 | + spec = PartitionSpec(PartitionField(1, 1000, IdentityTransform(), "s")) |
| 103 | + tbl = catalog.create_table("default.empty_string_partition", schema, partition_spec=spec) |
| 104 | + tbl.append(pa.table({"s": [""]}, schema=pa.schema([pa.field("s", pa.large_string())]))) |
| 105 | + |
| 106 | + partition_summary = tbl.inspect.manifests().to_pydict()["partition_summaries"][0][0] |
| 107 | + assert partition_summary["lower_bound"] == "" |
| 108 | + assert partition_summary["upper_bound"] == "" |
0 commit comments