-
Notifications
You must be signed in to change notification settings - Fork 437
fix: ignore local config during tests #3006
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Really clever find! Do we want to consider having some kind of |
|
thanks for catching this! ideally we shouldn't let external factors (such as the content of i remember we disables parsing the env and config file here iceberg-python/tests/cli/test_console.py Lines 40 to 42 in 7e66ccb
perhaps we can do this as the default for all tests |
|
Yeah, local config shouldn't bleed into pytest runs. The better fix is in the test infra rather than patching individual tests. I added a session-scoped autouse fixture in the root conftest that replaces Did a sanity test-coverage run and everything looks goood!!! |
Fokko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smart fix, thanks @geruh for picking this up 👍
kevinjqliu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
could you update the PR title and description to match the new fix?
|
I don't have permissions to change the PR title @kevinjqliu |
|
Thanks for the fix @geruh and thank you everyone for the review |
Rationale for this change
Fixes a test failure that hits anyone with PyIceberg already configured.
The test uses
load_catalog("default", type="in-memory"), which merges your dev environment config with the test parameters. If you have adefaultcatalog defined in~/.pyiceberg.yamlwith something like uri: https://best-rest-catalog.com, the merge produces{"uri": "https://best-rest-catalog.com", "type": "in-memory"}. SQLAlchemy sees that https:// URI and tries to load it as a database dialect, which fails wuth:Therefore, this PR avoids using the local pyicberg.yaml file entirely!
Are these changes tested?
Yes. I created a conflicting ~/.pyiceberg.yaml with a default catalog pointing to an HTTPS REST endpoint, confirmed the old code fails, and verified the fix bypasses the config merge and works.
Are there any user-facing changes?
No