fix: database connection validation when creation#11653
Merged
dpgaspar merged 1 commit intoapache:masterfrom Nov 12, 2020
Merged
fix: database connection validation when creation#11653dpgaspar merged 1 commit intoapache:masterfrom
dpgaspar merged 1 commit intoapache:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11653 +/- ##
==========================================
- Coverage 65.76% 61.87% -3.89%
==========================================
Files 873 873
Lines 42316 42310 -6
Branches 3972 3972
==========================================
- Hits 27827 26180 -1647
- Misses 14374 15950 +1576
- Partials 115 180 +65
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
4045167 to
82dfa7f
Compare
55dadd4 to
6491ca7
Compare
Member
|
@dpgaspar would you mind taking a look at this as it changes some of the logic related to your API refactor? |
bd1ef12 to
459be21
Compare
459be21 to
be2ce74
Compare
dpgaspar
approved these changes
Nov 12, 2020
ktmud
added a commit
to ktmud/superset
that referenced
this pull request
Nov 12, 2020
6 tasks
ktmud
added a commit
that referenced
this pull request
Nov 12, 2020
auxten
pushed a commit
to auxten/incubator-superset
that referenced
this pull request
Nov 20, 2020
auxten
pushed a commit
to auxten/incubator-superset
that referenced
this pull request
Nov 20, 2020
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.
SUMMARY
Better database connection validation when creating a database. Discovered this bug while developing #11509 , the symptom of the failed test on the user side is you can add databases with wrong passwords as long as
TABLE_NAMES_CACHE_CONFIGis enabled. The cause is that Database.get_all_schema_names is a cached function withself.idas cache key, but a newly created uncommitted Database instance always hasself.id == None.Also renames a couple of test databases to make it easier to debug in case some of them slip through failed tests and got incorrectly created.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TEST PLAN
To reproduce the bug with unit tests:
TABLE_NAMES_CACHE_CONFIGin test config. E.g.AssertionError: 201 != 422To reproduce the bug in user interface:
TABLE_NAMES_CACHE_CONFIGADDITIONAL INFORMATION
cc @dpgaspar @john-bodley