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: [sc-54864] Adds safety check to provide near term fix to save query #21034

Conversation

eric-briscoe
Copy link
Contributor

Adds safety check to provide near term fix to save query

SUMMARY

There is an error when casting the columns array to String() for saving queries where the objects in the array are missing the toString method. This is a near term rapid patch to fix workflow in production which will have a follow up to identify root cause.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

Repro steps:
1, go to sql lab and run query (click "RUN")
2, save query using save split button
3, observe confirmation msg
4, go to saved query list and look for save query

Expect:
user can save query using save split button

Actual:
user saw query can not be saved msg and the query did not show in save query list

ADDITIONAL INFORMATION

  • Has associated issue:
  • 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

… saving

There is an error when casting the columns array to String() for saving queries where the objects in the array are missing the toString method.   This is a near term rapid patch to fix workflow in production which will have a follow up to identify root cause.
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
Copy link
Member

@eschutho eschutho left a comment

Choose a reason for hiding this comment

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

Looks good, with one small console typo.

@eschutho eschutho closed this Aug 10, 2022
@eschutho eschutho reopened this Aug 10, 2022
This fixes issue caught by unit test where the if statement was using a truthy check where it should be explicitly checking for value of undefined
@eric-briscoe eric-briscoe changed the title fix: [sc-54864] Adds safety check to provide near term fix to save query fix: [sc-54864] Adds safety check to provide near term fix to save query Aug 10, 2022
@jinghua-qa
Copy link
Member

/testenv up

@github-actions
Copy link
Contributor

@jinghua-qa Ephemeral environment spinning up at http://54.214.187.229:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@codecov
Copy link

codecov bot commented Aug 10, 2022

Codecov Report

Merging #21034 (7ab1111) into master (3df8335) will decrease coverage by 0.07%.
The diff coverage is 62.50%.

@@            Coverage Diff             @@
##           master   #21034      +/-   ##
==========================================
- Coverage   66.34%   66.26%   -0.08%     
==========================================
  Files        1767     1769       +2     
  Lines       67358    67475     +117     
  Branches     7147     7171      +24     
==========================================
+ Hits        44686    44711      +25     
- Misses      20844    20933      +89     
- Partials     1828     1831       +3     
Flag Coverage Δ
javascript 52.01% <62.50%> (-0.11%) ⬇️

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.11% <0.00%> (-0.34%) ⬇️
...superset-ui-core/src/connection/callApi/callApi.ts 100.00% <100.00%> (ø)
...nents/DataTablesPane/components/useResultsPane.tsx 84.78% <0.00%> (-12.72%) ⬇️
...et-frontend/src/components/Chart/ChartRenderer.jsx 52.00% <0.00%> (-2.24%) ⬇️
...tend/plugins/plugin-chart-echarts/src/Pie/types.ts 100.00% <0.00%> (ø)
...nd/plugins/plugin-chart-echarts/src/Graph/types.ts 100.00% <0.00%> (ø)
...nd/plugins/plugin-chart-echarts/src/Radar/types.ts 100.00% <0.00%> (ø)
...d/plugins/plugin-chart-echarts/src/Funnel/types.ts 100.00% <0.00%> (ø)
.../plugins/plugin-chart-echarts/src/BoxPlot/types.ts 0.00% <0.00%> (ø)
.../plugins/plugin-chart-echarts/src/Treemap/types.ts 100.00% <0.00%> (ø)
... and 26 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@eschutho eschutho merged commit ab6ec89 into apache:master Aug 10, 2022
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

jinghua-qa pushed a commit to preset-io/superset that referenced this pull request Aug 10, 2022
…ery (apache#21034)

* [sc-54864] Adds safety check to provide near term fix for Queries not saving

There is an error when casting the columns array to String() for saving queries where the objects in the array are missing the toString method.   This is a near term rapid patch to fix workflow in production which will have a follow up to identify root cause.

* fix typo

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* Adjusted chekc to be explicit for undefined instead of truthy

This fixes issue caught by unit test where the if statement was using a truthy check where it should be explicitly checking for value of undefined

* Adds new unit test to get 100% coverage for callApi

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
(cherry picked from commit ab6ec89)
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 labels Mar 13, 2024
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 preset:2022.31 size/M 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants