|
28 | 28 | from pyiceberg.typedef import EMPTY_DICT
|
29 | 29 | from pyiceberg.types import NestedField, StringType
|
30 | 30 |
|
31 |
| -TABLE_SCHEMA = Schema(NestedField(field_id=2, name="field", field_type=StringType(), required=False)) |
32 |
| -PARTITION_FIELD = PartitionField(source_id=2, field_id=1002, transform=IdentityTransform(), name="part#field") |
33 |
| -PARTITION_SPEC = PartitionSpec(PARTITION_FIELD) |
| 31 | +PARTITION_FIELD = PartitionField(source_id=1, field_id=1002, transform=IdentityTransform(), name="string_field") |
34 | 32 | PARTITION_KEY = PartitionKey(
|
35 |
| - raw_partition_field_values=[PartitionFieldValue(PARTITION_FIELD, "example#val")], |
36 |
| - partition_spec=PARTITION_SPEC, |
37 |
| - schema=TABLE_SCHEMA, |
| 33 | + raw_partition_field_values=[PartitionFieldValue(PARTITION_FIELD, "example_string")], |
| 34 | + partition_spec=PartitionSpec(PARTITION_FIELD), |
| 35 | + schema=Schema(NestedField(field_id=1, name="string_field", field_type=StringType(), required=False)), |
38 | 36 | )
|
39 | 37 |
|
40 | 38 |
|
@@ -95,9 +93,7 @@ def test_partition_value_in_path(object_storage: bool) -> None:
|
95 | 93 | location = provider.new_data_location("test.parquet", PARTITION_KEY)
|
96 | 94 | partition_segment = location.split("/")[-2]
|
97 | 95 |
|
98 |
| - # Field name is not encoded but partition value is - this differs from the Java implementation |
99 |
| - # https://github.com/apache/iceberg/blob/cdf748e8e5537f13d861aa4c617a51f3e11dc97c/core/src/test/java/org/apache/iceberg/TestLocationProvider.java#L304 |
100 |
| - assert partition_segment == "part#field=example%23val" |
| 96 | + assert partition_segment == "string_field=example_string" |
101 | 97 |
|
102 | 98 |
|
103 | 99 | def test_object_storage_exclude_partition_in_path() -> None:
|
|
0 commit comments