smaheshwar-pltr commented on code in PR #1452:
URL: https://github.com/apache/iceberg-python/pull/1452#discussion_r1893325887
##########
pyiceberg/io/__init__.py:
##########
@@ -344,6 +370,40 @@ def _infer_file_io_from_scheme(path: str, properties:
Properties) -> Optional[Fi
return None
+def _import_location_provider(location_provider_impl: str, table_location:
str, table_properties: Properties) -> Optional[LocationProvider]:
+ try:
+ path_parts = location_provider_impl.split(".")
+ if len(path_parts) < 2:
+ raise
ValueError(f"{TableProperties.LOCATION_PROVIDER_IMPL_DEFAULT} should be full
path (module.CustomLocationProvider), got: {location_provider_impl}")
+ module_name, class_name = ".".join(path_parts[:-1]), path_parts[-1]
+ module = importlib.import_module(module_name)
+ class_ = getattr(module, class_name)
Review Comment:
Can we reduce the duplication between this and IO?
--
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]