Skip to content

Read py-catalog-impl from the catalog configuration - #4301

Draft
chenjian2664 wants to merge 1 commit into
apache:mainfrom
chenjian2664:chenjian2664/bytequay/read-py-catalog-impl-from-catalog-config
Draft

chenjian2664 wants to merge 1 commit into
apache:mainfrom
chenjian2664:chenjian2664/bytequay/read-py-catalog-impl-from-catalog-config

Conversation

@chenjian2664

Copy link
Copy Markdown

Rationale for this change

load_catalog only read py-catalog-impl from its keyword arguments. A custom catalog configured in .pyiceberg.yaml, as the configuration docs show, or through PYICEBERG_CATALOG__<NAME>__PY_CATALOG_IMPL was ignored, so loading failed with "URI missing" or picked another catalog type. When the implementation was passed as an argument, the custom catalog also lost the properties from the configuration file.

py-catalog-impl is now read from the merged configuration, and that configuration is passed to the custom catalog.

Are these changes tested?

Are there any user-facing changes?

Yes. A py-catalog-impl set in the configuration file or environment variables now takes effect.

load_catalog only looked for py-catalog-impl in its keyword arguments, so
the documented .pyiceberg.yaml and PYICEBERG_CATALOG__* settings were
ignored and loading failed with "URI missing". When the implementation was
passed as an argument, the custom catalog also lost the properties from the
configuration. Read it from the merged configuration and pass that
configuration to the custom catalog.

test_missing_uri patched the configuration with a MagicMock rather than a
Config, so it now patches an empty Config again.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant