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


##########
tests/table/test_locations.py:
##########
@@ -82,19 +88,18 @@ def test_object_storage_injects_entropy() -> None:
         assert all(c in "01" for c in dir_name)
 
 
-@pytest.mark.parametrize("object_storage", [True, False])
-def test_partition_value_in_path(object_storage: bool) -> None:
+def test_object_storage_with_partition() -> None:
     provider = load_location_provider(
         table_location="table_location",
-        table_properties={
-            "write.object-storage.enabled": str(object_storage),
-        },
+        table_properties={"write.object-storage.enabled": "true"},
     )
 
     location = provider.new_data_location("test.parquet", PARTITION_KEY)
-    partition_segment = location.split("/")[-2]
 
-    assert partition_segment == "string_field=example_string"
+    # Partition values AND entropy included in the path. Entropy differs to 
that in the test below because the partition
+    # key AND the data file name are used as the hash input. This matches Java 
behaviour; the hash below is what the
+    # Java implementation produces for this input too.

Review Comment:
   I've verified this. There's no test of this in 
https://github.com/apache/iceberg/blob/main/core/src/test/java/org/apache/iceberg/TestLocationProvider.java
 that we can take the hash from sadly.
   
   I like testing this here. It's not obvious that both partition key and file 
name are used as hash input.



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to