@@ -233,7 +233,7 @@ def load_catalog(name: Optional[str] = None, **properties: Optional[str]) -> Cat
233233 conf : RecursiveDict = merge_config (env or {}, cast (RecursiveDict , properties ))
234234
235235 if catalog_impl := properties .get (PY_CATALOG_IMPL ):
236- if catalog := _import_catalog (catalog_impl , properties ):
236+ if catalog := _import_catalog (name , catalog_impl , properties ):
237237 logger .info ("Loaded Catalog: %s" , catalog_impl )
238238 return catalog
239239 else :
@@ -292,15 +292,15 @@ def delete_data_files(io: FileIO, manifests_to_delete: List[ManifestFile]) -> No
292292 deleted_files [path ] = True
293293
294294
295- def _import_catalog (catalog_impl : str , properties : Properties ) -> Optional [Catalog ]:
295+ def _import_catalog (name : str , catalog_impl : str , properties : Properties ) -> Optional [Catalog ]:
296296 try :
297297 path_parts = catalog_impl .split ("." )
298298 if len (path_parts ) < 2 :
299299 raise ValueError (f"py-catalog-impl should be full path (module.CustomCatalog), got: { catalog_impl } " )
300300 module_name , class_name = "." .join (path_parts [:- 1 ]), path_parts [- 1 ]
301301 module = importlib .import_module (module_name )
302302 class_ = getattr (module , class_name )
303- return class_ (properties )
303+ return class_ (name , ** properties )
304304 except ModuleNotFoundError :
305305 logger .warning ("Could not initialize Catalog: %s" , catalog_impl )
306306 return None
0 commit comments