-
Notifications
You must be signed in to change notification settings - Fork 14k
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
fix: get or create db with an existing invalid URL #23737
Conversation
Codecov Report
@@ Coverage Diff @@
## master #23737 +/- ##
=======================================
Coverage 68.11% 68.11%
=======================================
Files 1922 1922
Lines 74102 74103 +1
Branches 8100 8100
=======================================
+ Hits 50474 50476 +2
+ Misses 21550 21549 -1
Partials 2078 2078
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 5 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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
except (ArgumentError, ValueError): | ||
except DatabaseInvalidError: |
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.
I almost asked about why the old exceptions here aren't valid any more. To answer that question for other potential reviewers: we're already reraising all exceptions to DatabaseInvalidError
here:
superset/superset/databases/utils.py
Lines 120 to 121 in 44557f5
except Exception: | |
raise DatabaseInvalidError() # pylint: disable=raise-missing-from |
(cherry picked from commit f80e738)
SUMMARY
When an existing invalid URL on the examples database exists, updating or reseting the examples database connection fails with:
With this fix the
get_or_create_db
can support the existing invalid URI and update it URI with a new valid URIBEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION