smaheshwar-pltr commented on code in PR #1457:
URL: https://github.com/apache/iceberg-python/pull/1457#discussion_r1895779686


##########
tests/table/test_partitioning.py:
##########
@@ -118,6 +119,27 @@ def test_deserialize_partition_spec() -> None:
     )
 
 
+def test_partition_spec_to_path() -> None:
+    schema = Schema(
+        NestedField(field_id=1, name="str", field_type=StringType(), 
required=False),
+        NestedField(field_id=2, name="other_str", field_type=StringType(), 
required=False),
+        NestedField(field_id=3, name="int", field_type=IntegerType(), 
required=True),
+    )
+
+    spec = PartitionSpec(
+        PartitionField(source_id=1, field_id=1000, 
transform=TruncateTransform(width=19), name="my#str%bucket"),
+        PartitionField(source_id=2, field_id=1001, 
transform=IdentityTransform(), name="other str+bucket"),
+        PartitionField(source_id=3, field_id=1002, 
transform=BucketTransform(num_buckets=25), name="my!int:bucket"),
+        spec_id=3,
+    )
+
+    record = Record(**{"my#str%bucket": "my+str", "other str+bucket": "( )", 
"my!int:bucket": 10})  # type: ignore

Review Comment:
   mypy [complains](https://github.com/python/mypy/issues/5382) here



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to