Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: add UUID column to saved_query for export/import #11397

Merged
merged 8 commits into from
Oct 27, 2020

Conversation

betodealmeida
Copy link
Member

SUMMARY

This PR adds the ImportMixin base class to the SavedQuery model, as well as adding a DB migration that adds and populates the column.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TEST PLAN

  1. Ran superset db upgrade and verified that saved queries have a UUID
  2. Ran superset db downgrade af30ca79208f and verified that column is removed.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@codecov-io
Copy link

codecov-io commented Oct 22, 2020

Codecov Report

Merging #11397 into master will decrease coverage by 4.51%.
The diff coverage is 8.51%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11397      +/-   ##
==========================================
- Coverage   66.64%   62.13%   -4.52%     
==========================================
  Files         861      862       +1     
  Lines       40935    40973      +38     
  Branches     3700     3700              
==========================================
- Hits        27283    25460    -1823     
- Misses      13554    15333    +1779     
- Partials       98      180      +82     
Flag Coverage Δ
#cypress ?
#javascript 62.88% <ø> (ø)
#python 61.70% <8.51%> (-0.27%) ⬇️

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

Impacted Files Coverage Δ
...s/96e99fb176a0_add_import_mixing_to_saved_query.py 0.00% <0.00%> (ø)
...ns/b56500de1855_add_uuid_column_to_import_mixin.py 0.00% <0.00%> (ø)
superset/models/sql_lab.py 90.97% <100.00%> (+0.12%) ⬆️
superset-frontend/src/SqlLab/App.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/explore/App.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/dashboard/App.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/explore/index.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/dashboard/index.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/setup/setupColors.js 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/chart/ChartContainer.jsx 0.00% <0.00%> (-100.00%) ⬇️
... and 181 more

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 81f77fd...d2d2450. Read the comment docs.

}


def add_uuids(session, batch_size=default_batch_size):
Copy link
Member

Choose a reason for hiding this comment

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

Maybe you can import these functions from the earlier migration script to DRY and also indicate they are related?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was on the fence about doing this, because it requires small changes in the previous script, and changing a previous migration script seems dangerous.

In this case it seems safe enough... let me know what you think.

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense. Didn't know updates were needed, in that case I'm OK with either approach.

Copy link
Member

@ktmud ktmud left a comment

Choose a reason for hiding this comment

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

The updated code looks good, but the tests seem to be failing because of conflicting HEADs. Is it because of the cross-version import?

@betodealmeida
Copy link
Member Author

The updated code looks good, but the tests seem to be failing because of conflicting HEADs. Is it because of the cross-version import?

Someone committed a DB migration to master after I created my script, so now we have two HEADS in the Alembic DAG. Let me fix that.

@betodealmeida betodealmeida merged commit 98daf0a into apache:master Oct 27, 2020
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
* Add UUID to saved_query

* Reuse function from previous migration

* Point to new head
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.0.0 labels Mar 12, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 1.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants