rdblue commented on code in PR #5488:
URL: https://github.com/apache/iceberg/pull/5488#discussion_r946995050


##########
python/pyiceberg/catalog/__init__.py:
##########
@@ -53,7 +54,15 @@ class Catalog(ABC):
 
     def __init__(self, name: str | None, **properties: str):
         self.name = name
-        self.properties = properties
+
+        if name is not None:
+            configuration = Config().get_catalog_config(name)

Review Comment:
   I'd prefer not to load configuration from files every time a catalog is 
created. It also seems a bit strange to me to make this depend directly on 
config rather than passing it in.
   
   On the other hand, I can see why it would be great to be able to rely on the 
environment config always being used so that callers don't need to instantiate 
their own `Config` and merge properties themselves.
   
   How about using a factory method like this?
   
   ```python
   _env_config = Config()
   
   def load_catalog(name: str, **properties: str):
       env = _env_config.get_catalog_config(name)
       conf = merge_config(env or {}, properties)
       impl = conf['py-impl'] # not sure how we're doing this yet
       return impl(name, conf)
   ```



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