Repository navigation
Fix selected catalog persistence and completion refresh - #89
Open
dajiaohuang wants to merge 2 commits into
Open
dajiaohuang wants to merge 2 commits into
dajiaohuang wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Keep the catalog selected by
[catalog.]databaseconsistent across connections:athenacli custom.analyticsstoresanalyticsas the database, but the completion refresher creates a new executor with only that database. It therefore reconnects toAwsDataCatalog, so completion metadata comes from a different catalog than queries.use other.reportingconnects tootherbut does not update the stored catalog. A subsequentuse archive, reconnect, or completion refresh returns to the old catalog.Preserve the catalog after a successful database change and pass it explicitly into the completion executor. The default remains
AwsDataCatalog; qualified database arguments still select the catalog. This follows the catalog/USE behavior introduced by #82.Validation: offline pytest on Python 3.11: 58 passed, 1 XPASS, including four new tests for refresh, database changes/reconnect, the default catalog, and failed connection state. Also exercised the public CLI and
AthenaCli.change_dbwith an owned PyAthena connection mock; baseline refresh selectedAwsDataCatalog, corrected refresh selectedcustom.All execution used isolated HOME/config, synthetic credentials, disabled SDK credential discovery and blocked network connections. No real Athena/S3/IAM request or paid query was made; live AWS and Python 3.6–3.8 acceptance are untested. Existing deprecation warnings remain.
Checklist
changelog.md.AUTHORSfile (or it's already there).