lk-1984 commented on issue #1771:
URL: 
https://github.com/apache/iceberg-python/issues/1771#issuecomment-2705666108

   
https://github.com/apache/iceberg-python/blob/main/pyiceberg/utils/config.py#L152
   
   This is is the reason why an empty config is returned.
   
   ```
       def get_catalog_config(self, catalog_name: str) -> 
Optional[RecursiveDict]:
           print(f"self.config: {self.config}")
           print(f"CATALOG: {CATALOG}")
           if CATALOG in self.config:
               catalog_name_lower = catalog_name.lower()
               catalogs = self.config[CATALOG]
               print(f"catalog_name_lower: {catalog_name_lower}")
               print(f"catalogs: {catalogs}")
               print(f"not isinstance(catalogs, dict): {not 
isinstance(catalogs, dict)}")
               if not isinstance(catalogs, dict):
                   raise ValueError(f"Catalog configurations needs to be an 
object: {catalog_name}")
               print(f"catalog_name_lower in catalogs: {catalog_name_lower in 
catalogs:}")
               if catalog_name_lower in catalogs:
                   catalog_conf = catalogs[catalog_name_lower]
                   assert isinstance(catalog_conf, dict), f"Configuration path 
catalogs.{catalog_name_lower} needs to be an object"
                   return catalog_conf
           print("THIS SHOULD NOT HAPPEN, BUT IT DID")
           return None
   ```
   
   ```
   self.config: {'catalog': {'hive': {'uri': 'thrift://localhost:9083', 
's3.endpoint': 'http://localhost:9100', 's3.access-key-id': 'admin', 
's3.secret-access-key': 'adminadmin', 's3.region': 'us-east-1'}}, 'home': 
'/Users/dev/Projects/external/iceberg-python'}
   CATALOG: catalog
   catalog_name_lower: default
   catalogs: {'hive': {'uri': 'thrift://localhost:9083', 's3.endpoint': 
'http://localhost:9100', 's3.access-key-id': 'admin', 's3.secret-access-key': 
'adminadmin', 's3.region': 'us-east-1'}}
   not isinstance(catalogs, dict): False
   catalog_name_lower in catalogs: False
   THIS SHOULD NOT HAPPEN, BUT IT DID
   env: None
   new_config: {}
   env: {}
   catalog_properties: {}
   URI missing, please provide using --uri, the config or environment variable 
PYICEBERG_CATALOG__DEFAULT__URI
   ```


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