rdblue commented on code in PR #5488:
URL: https://github.com/apache/iceberg/pull/5488#discussion_r947175184
##########
python/pyiceberg/catalog/__init__.py:
##########
@@ -25,6 +26,41 @@
from pyiceberg.table.partitioning import UNPARTITIONED_PARTITION_SPEC,
PartitionSpec
from pyiceberg.table.sorting import UNSORTED_SORT_ORDER, SortOrder
from pyiceberg.typedef import EMPTY_DICT, Identifier, Properties
+from pyiceberg.utils.config import Config, merge_config
+
+logger = logging.getLogger(__name__)
+
+_env_config = Config()
+
+
+def load_catalog(name: str, uri: str, **properties: str | None) -> Catalog:
+ from pyiceberg.catalog.rest import RestCatalog
+
+ supported_catalogs: dict[str, type[Catalog]] = {"http": RestCatalog}
+
+ try:
+ # In case Thrift isn't installed
+ from pyiceberg.catalog.hive import HiveCatalog
+
+ supported_catalogs["thrift"] = HiveCatalog
+ except ImportError:
+ logger.warning("Apache Hive not supported, to enable: pip install
'pyiceberg[hive]'")
+
+ if name:
Review Comment:
I think name should always be required. If we are creating some default
catalog, we can use a default name (or randomly generate one).
--
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]