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: Columns not passing properly from SQL Lab to Explore #20975

Merged
merged 3 commits into from
Aug 4, 2022

Conversation

lyndsiWilliams
Copy link
Member

@lyndsiWilliams lyndsiWilliams commented Aug 4, 2022

SUMMARY

Columns were not passing properly from SQL Lab to Explore. This PR fixes that by passing the columns from latestQuery.results.columns into SaveQuery from SqlEditor.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

  • Go to SQL Lab and run a query with columns
  • Click the carat v button on the save button and click Save Dataset
  • Click Save & Explore
  • Observe that the columns have passed to the dataset properly

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

@@ -151,6 +151,7 @@ export const SaveDatasetModal: FunctionComponent<SaveDatasetModalProps> = ({
openWindow = true,
formData = {},
}) => {
console.log('FINDME SaveDatasetModal', datasource);
Copy link
Member

Choose a reason for hiding this comment

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

remove this

Copy link
Member Author

Choose a reason for hiding this comment

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

This was just debugging, it wasn't ready for review yet. I pushed up a "clean up" commit here.

...qe,
columns: this.props.latestQuery?.results?.columns || [],
});
console.log('findme SqlEditor', qe, queryWithColumns());
Copy link
Member

Choose a reason for hiding this comment

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

remove this

Copy link
Member Author

Choose a reason for hiding this comment

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

This was just debugging, it wasn't ready for review yet. I pushed up a "clean up" commit here.

@@ -166,6 +167,7 @@ export default function SaveQuery({
</Form>
);

console.log('FINDME SaveQuery', query, queryPayload());
Copy link
Member

Choose a reason for hiding this comment

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

remove this

Copy link
Member Author

Choose a reason for hiding this comment

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

This was just debugging, it wasn't ready for review yet. I pushed up a "clean up" commit here.

@codecov
Copy link

codecov bot commented Aug 4, 2022

Codecov Report

Merging #20975 (2c41a85) into master (aa53c10) will decrease coverage by 0.19%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master   #20975      +/-   ##
==========================================
- Coverage   66.38%   66.18%   -0.20%     
==========================================
  Files        1766     1767       +1     
  Lines       67225    67246      +21     
  Branches     7137     7142       +5     
==========================================
- Hits        44625    44509     -116     
- Misses      20774    20909     +135     
- Partials     1826     1828       +2     
Flag Coverage Δ
hive ?
javascript 52.10% <100.00%> (-0.01%) ⬇️
mysql 81.02% <ø> (ø)
postgres 81.09% <ø> (ø)
presto ?
python 81.18% <ø> (-0.39%) ⬇️
sqlite 79.67% <ø> (ø)
unit ?

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

Impacted Files Coverage Δ
...frontend/src/SqlLab/components/SaveQuery/index.tsx 74.35% <ø> (ø)
superset-frontend/src/utils/datasourceUtils.js 100.00% <ø> (ø)
...frontend/src/SqlLab/components/SqlEditor/index.jsx 51.63% <100.00%> (+0.26%) ⬆️
superset/db_engines/hive.py 0.00% <0.00%> (-85.19%) ⬇️
superset/db_engine_specs/hive.py 71.04% <0.00%> (-15.84%) ⬇️
superset/db_engine_specs/presto.py 81.36% <0.00%> (-6.62%) ⬇️
superset/models/sql_lab.py 76.66% <0.00%> (-2.09%) ⬇️
superset/initialization/__init__.py 89.96% <0.00%> (-1.74%) ⬇️
superset/connectors/sqla/models.py 89.19% <0.00%> (-1.15%) ⬇️
superset/db_engine_specs/base.py 87.87% <0.00%> (-0.34%) ⬇️
... and 5 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@lyndsiWilliams lyndsiWilliams marked this pull request as ready for review August 4, 2022 16:56
Copy link
Member

@hughhhh hughhhh left a comment

Choose a reason for hiding this comment

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

LGTM

@hughhhh
Copy link
Member

hughhhh commented Aug 4, 2022

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2022

@hughhhh Ephemeral environment spinning up at http://34.220.152.102:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@hughhhh hughhhh merged commit d42cf4e into master Aug 4, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2022

Ephemeral environment shutdown and build artifacts deleted.

jinghua-qa pushed a commit to preset-io/superset that referenced this pull request Aug 4, 2022
* debugging columns

* Clean up code

* Fix test

(cherry picked from commit d42cf4e)
@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
@mistercrunch mistercrunch deleted the lyndsi/dataset-column-fix branch March 26, 2024 16:15
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/S 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants