Anurag-S1ngh commented on code in PR #4597:
URL: https://github.com/apache/iceberg-python/pull/4597#discussion_r4810905393


##########
pyiceberg/catalog/hive.py:
##########
@@ -369,7 +383,7 @@ def _convert_iceberg_into_hive(self, table: Table) -> 
HiveTable:
         return HiveTable(
             dbName=database_name,
             tableName=table_name,
-            owner=table.properties[OWNER] if table.properties and OWNER in 
table.properties else getpass.getuser(),
+            owner=get_first_property_value(table.properties or {}, OWNER, 
HIVE_METASTORE_TABLE_OWNER) or getpass.getuser(),

Review Comment:
   Filtered `hive.metastore.table.owner` out of `_construct_parameters`, and 
the create table tests now assert it is not in the HMS parameters.



##########
pyiceberg/catalog/hive.py:
##########
@@ -235,12 +239,22 @@ def _construct_parameters(
 
 
 def _annotate_namespace(database: HiveDatabase, properties: Properties) -> 
HiveDatabase:
+    if HIVE_METASTORE_DATABASE_OWNER_TYPE in properties and 
HIVE_METASTORE_DATABASE_OWNER not in properties:
+        raise ValueError(f"{HIVE_METASTORE_DATABASE_OWNER_TYPE} requires 
{HIVE_METASTORE_DATABASE_OWNER}")
+
     params = {}
     for key, value in properties.items():
         if key == COMMENT:
             database.description = value
         elif key == LOCATION:

Review Comment:
   `load_namespace_properties` now returns `hive.metastore.database.owner` and 
`owner-type`. `update_namespace_properties` removes both keys together and no 
longer reports the owner as missing. Added tests for the load and removal paths.



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