ebyhr commented on code in PR #3602:
URL: https://github.com/apache/iceberg-python/pull/3602#discussion_r3525663357


##########
tests/catalog/test_dynamodb.py:
##########
@@ -502,6 +502,26 @@ def test_load_namespace_properties(_bucket_initialize: 
None, database_name: str)
         assert v == test_properties[k]
 
 
+@mock_aws
+def test_load_namespace_properties_with_prefix_char_keys(_bucket_initialize: 
None, database_name: str) -> None:
+    # Property keys starting with a character in the "p." prefix (e.g. "p" or 
".") must
+    # survive a round trip. The stored keys are prefixed with 
PROPERTY_KEY_PREFIX ("p."),
+    # so decoding must strip only that literal prefix, not any leading "p"/"." 
characters.
+    test_properties = {
+        "provider": "s3",
+        "path": f"s3://{BUCKET_NAME}/{database_name}.db",
+        "ppp": "3",
+        ".hidden": "yes",
+        "comment": "not affected",
+    }
+    test_catalog = DynamoDbCatalog("test_ddb_catalog")
+    test_catalog.create_namespace(database_name, test_properties)
+    listed_properties = test_catalog.load_namespace_properties(database_name)
+    for k, v in test_properties.items():
+        assert k in listed_properties
+        assert listed_properties[k] == v
+

Review Comment:
   This only asserts expected keys appear in result (subset check), not that 
result contains no extra keys. We could simply verify the entire properties:
   
   ```py
   assert listed_properties == test_properties
   ```



-- 
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