Skip to content

Commit

Permalink
Remove special character testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Sreesh Maheshwar committed Dec 21, 2024
1 parent bc2eab8 commit 9999cbb
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions tests/table/test_locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@
from pyiceberg.typedef import EMPTY_DICT
from pyiceberg.types import NestedField, StringType

TABLE_SCHEMA = Schema(NestedField(field_id=2, name="field", field_type=StringType(), required=False))
PARTITION_FIELD = PartitionField(source_id=2, field_id=1002, transform=IdentityTransform(), name="part#field")
PARTITION_SPEC = PartitionSpec(PARTITION_FIELD)
PARTITION_FIELD = PartitionField(source_id=1, field_id=1002, transform=IdentityTransform(), name="string_field")
PARTITION_KEY = PartitionKey(
raw_partition_field_values=[PartitionFieldValue(PARTITION_FIELD, "example#val")],
partition_spec=PARTITION_SPEC,
schema=TABLE_SCHEMA,
raw_partition_field_values=[PartitionFieldValue(PARTITION_FIELD, "example_string")],
partition_spec=PartitionSpec(PARTITION_FIELD),
schema=Schema(NestedField(field_id=1, name="string_field", field_type=StringType(), required=False)),
)


Expand Down Expand Up @@ -95,9 +93,7 @@ def test_partition_value_in_path(object_storage: bool) -> None:
location = provider.new_data_location("test.parquet", PARTITION_KEY)
partition_segment = location.split("/")[-2]

# Field name is not encoded but partition value is - this differs from the Java implementation
# https://github.com/apache/iceberg/blob/cdf748e8e5537f13d861aa4c617a51f3e11dc97c/core/src/test/java/org/apache/iceberg/TestLocationProvider.java#L304
assert partition_segment == "part#field=example%23val"
assert partition_segment == "string_field=example_string"


def test_object_storage_exclude_partition_in_path() -> None:
Expand Down

0 comments on commit 9999cbb

Please sign in to comment.