-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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(sql-lab): do not replace undefined schema with empty object #19664
Conversation
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
Codecov Report
@@ Coverage Diff @@
## master #19664 +/- ##
=======================================
Coverage 66.47% 66.47%
=======================================
Files 1681 1681
Lines 64467 64467
Branches 6607 6607
=======================================
Hits 42856 42856
Misses 19917 19917
Partials 1694 1694
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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!
(cherry picked from commit 87d4798)
SUMMARY
In a change introduced in #18609, SQL Lab incorrectly replaces a missing schema with an empty object when dispatching the query action, which causes the query to fail in the backend, which later breaks the whole UI and makes it impossible to enter SQL Lab again.
See a few examples of what a valid schema is in this context:
superset/superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx
Line 42 in 3a231f6
superset/superset-frontend/src/components/DatabaseSelector/index.tsx
Line 96 in 3a231f6
superset/superset-frontend/src/components/DatabaseSelector/index.tsx
Line 99 in 3a231f6
AFTER
Now SQL Lab executes correctly even when not selecting a schema:
BEFORE
Previously the schema would fail to execute due to the empty object not being compatible with the column type in the metastore:
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION