Skip to content
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

Merged
merged 1 commit into from
Apr 12, 2022

Conversation

villebro
Copy link
Member

@villebro villebro commented Apr 12, 2022

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:

queryEditorSetSchema: (queryEditor: QueryEditor, schema?: string) => void;

onSchemaChange?: (schema?: string) => void;

AFTER

Now SQL Lab executes correctly even when not selecting a schema:
image

BEFORE

Previously the schema would fail to execute due to the empty object not being compatible with the column type in the metastore:
image

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue: closes DB Engine error 1.5.0rc2  #19658
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Copy link
Member

@zhaoyongjie zhaoyongjie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov
Copy link

codecov bot commented Apr 12, 2022

Codecov Report

Merging #19664 (f3f70e2) into master (3a231f6) will not change coverage.
The diff coverage is n/a.

@@           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           
Flag Coverage Δ
javascript 51.14% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset-frontend/src/SqlLab/actions/sqlLab.js 60.39% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3a231f6...f3f70e2. Read the comment docs.

@villebro villebro merged commit 87d4798 into apache:master Apr 12, 2022
@villebro villebro deleted the villebro/sqllab-schema branch April 12, 2022 12:13
Copy link
Member

@kgabryje kgabryje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

villebro added a commit that referenced this pull request Apr 15, 2022
philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
@mistercrunch mistercrunch added 🍒 1.5.0 🍒 1.5.1 🍒 1.5.2 🍒 1.5.3 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.0 labels Mar 13, 2024
@dosubot dosubot bot mentioned this pull request Jul 4, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels lts-v1 preset-io size/XS 🍒 1.5.0 🍒 1.5.1 🍒 1.5.2 🍒 1.5.3 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DB Engine error 1.5.0rc2
5 participants