From 50aef7d8c280d04b5be8becb562e6243cf0868f1 Mon Sep 17 00:00:00 2001 From: Kevin Liu Date: Tue, 25 Feb 2025 15:11:51 -0800 Subject: [PATCH 1/2] fix in-memory --- pyiceberg/catalog/__init__.py | 2 +- tests/catalog/test_base.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pyiceberg/catalog/__init__.py b/pyiceberg/catalog/__init__.py index 01dd228efb..cf649ba7d6 100644 --- a/pyiceberg/catalog/__init__.py +++ b/pyiceberg/catalog/__init__.py @@ -252,7 +252,7 @@ def load_catalog(name: Optional[str] = None, **properties: Optional[str]) -> Cat catalog_type = None if provided_catalog_type and isinstance(provided_catalog_type, str): - catalog_type = CatalogType[provided_catalog_type.upper()] + catalog_type = CatalogType(provided_catalog_type.lower()) elif not provided_catalog_type: catalog_type = infer_catalog_type(name, conf) diff --git a/tests/catalog/test_base.py b/tests/catalog/test_base.py index c00f4fde95..34c675d572 100644 --- a/tests/catalog/test_base.py +++ b/tests/catalog/test_base.py @@ -88,6 +88,10 @@ def given_catalog_has_a_table( ) +def test_load_catalog_in_memory() -> None: + assert load_catalog("catalog", **{"type": "in-memory"}) + + def test_load_catalog_impl_not_full_path() -> None: with pytest.raises(ValueError) as exc_info: load_catalog("catalog", **{"py-catalog-impl": "CustomCatalog"}) From 74fda37de0be8ec103d99cd11f32a05962d061c0 Mon Sep 17 00:00:00 2001 From: Kevin Liu Date: Tue, 25 Feb 2025 15:20:12 -0800 Subject: [PATCH 2/2] lint --- tests/catalog/test_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/catalog/test_base.py b/tests/catalog/test_base.py index 34c675d572..6e00bfec3a 100644 --- a/tests/catalog/test_base.py +++ b/tests/catalog/test_base.py @@ -89,7 +89,7 @@ def given_catalog_has_a_table( def test_load_catalog_in_memory() -> None: - assert load_catalog("catalog", **{"type": "in-memory"}) + assert load_catalog("catalog", type="in-memory") def test_load_catalog_impl_not_full_path() -> None: