Commit 8bfb16c
authored
fix loading
Previously `CatalogType` was fetched by key,
`CatalogType[provided_catalog_type.upper()]` (note the bracket)
This PR changes `CatalogType` to be fetched by value,
`CatalogType(provided_catalog_type.lower())` (note the parenthesis)
https://stackoverflow.com/questions/29799235/python-enum-value2member-map-accessor
This fix loading `in-memory` catalog, `load_catalog("catalog",
**{"type": "in-memory"})`.
Previously, `"in-memory"` caused a key error because its key is
`IN_MEMORY`. Note the `-` vs `_`.
https://github.com/apache/iceberg-python/blob/1d24e71041e35e26e126aa4508ed7384e8aa031c/pyiceberg/catalog/__init__.py#L113-L119
We want `in-memory` and not `in_memory` to match spark
https://github.com/apache/iceberg-python/blob/1d24e71041e35e26e126aa4508ed7384e8aa031c/dev/spark-defaults.conf#L35in-memory catalog (#1725)1 parent acb3c47 commit 8bfb16c
2 files changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
91 | 95 | | |
92 | 96 | | |
93 | 97 | | |
| |||
0 commit comments