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

feat: auto sync table columns when change dataset #15887

Merged
merged 7 commits into from
Aug 2, 2021

Conversation

zhaoyongjie
Copy link
Member

@zhaoyongjie zhaoyongjie commented Jul 25, 2021

SUMMARY

Currently, Superset is unable to auto sync table columns when changing dataset "pointer/reference". This issue introduces a new API to support.

Limitation:
Currently, the dataset system is unable to save duplicated datasets (database/schema/table all the same). If "re-pointer" an existing dataset, the database will return an integrity error. I will fix it in separate PR.

UI Change:
Not allowed to click sync columns from source when dataset in EDIT mode. The system will automatically complete the sync.

closes: #15789

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

After

autosync_conversion.mp4

TESTING INSTRUCTIONS

  1. Open edit dataset modal in dataset list
  2. change table(Whether physical table or virtual table), schema, database
  3. Observe columns, auto sync table columns.

ADDITIONAL INFORMATION

@codecov
Copy link

codecov bot commented Jul 25, 2021

Codecov Report

Merging #15887 (85bf5c8) into master (c01d42f) will decrease coverage by 0.23%.
The diff coverage is 84.52%.

❗ Current head 85bf5c8 differs from pull request most recent head 95b871b. Consider uploading reports for the commit 95b871b to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15887      +/-   ##
==========================================
- Coverage   77.03%   76.80%   -0.24%     
==========================================
  Files         989      990       +1     
  Lines       52410    52455      +45     
  Branches     6634     6637       +3     
==========================================
- Hits        40376    40289      -87     
- Misses      11811    11942     +131     
- Partials      223      224       +1     
Flag Coverage Δ
hive ?
javascript 71.51% <45.45%> (-0.02%) ⬇️
mysql 81.61% <90.41%> (+0.02%) ⬆️
postgres 81.67% <90.41%> (+0.02%) ⬆️
presto ?
python 81.72% <90.41%> (-0.44%) ⬇️
sqlite ?

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

Impacted Files Coverage Δ
superset/security/manager.py 91.90% <ø> (ø)
...erset-frontend/src/datasource/DatasourceEditor.jsx 73.46% <45.45%> (-1.54%) ⬇️
superset/connectors/sqla/utils.py 87.50% <87.50%> (ø)
superset/views/datasource.py 90.12% <95.00%> (+1.59%) ⬆️
superset/connectors/sqla/models.py 88.00% <100.00%> (-1.84%) ⬇️
superset/db_engines/hive.py 0.00% <0.00%> (-82.15%) ⬇️
superset/db_engine_specs/hive.py 69.80% <0.00%> (-16.87%) ⬇️
superset/db_engine_specs/presto.py 83.47% <0.00%> (-6.49%) ⬇️
superset/db_engine_specs/sqlite.py 91.89% <0.00%> (-5.41%) ⬇️
superset/utils/celery.py 86.20% <0.00%> (-3.45%) ⬇️
... and 9 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 c01d42f...95b871b. Read the comment docs.

@junlincc
Copy link
Member

/testenv up

@github-actions
Copy link
Contributor

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

@junlincc junlincc removed the hold:testing! On hold for testing label Jul 28, 2021
Copy link
Contributor

@rosemarie-chiu rosemarie-chiu left a comment

Choose a reason for hiding this comment

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

LGTM on UI

CleanShot.2021-07-28.at.10.35.34.mp4

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

Thanks for the fix and the general cleanup! I almost think we shouldn't be able to change the dataset when inside the modal (if the user wants to change dataset, they should probably close the modal and then change the dataset and reopen the modal). However, this change can be postponed to later after proper discussion about the UX has been done.

@zhaoyongjie zhaoyongjie merged commit a786373 into apache:master Aug 2, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Aug 2, 2021

Ephemeral environment shutdown and build artifacts deleted.

opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
* feat: auto sync dataset metadata when change dataset

* diablo sync button when edit mode

* handle undefine schema

* fix py UT

* fix FE UT

* improve test coverage

* fix UT
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
* feat: auto sync dataset metadata when change dataset

* diablo sync button when edit mode

* handle undefine schema

* fix py UT

* fix FE UT

* improve test coverage

* fix UT
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
* feat: auto sync dataset metadata when change dataset

* diablo sync button when edit mode

* handle undefine schema

* fix py UT

* fix FE UT

* improve test coverage

* fix UT
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
* feat: auto sync dataset metadata when change dataset

* diablo sync button when edit mode

* handle undefine schema

* fix py UT

* fix FE UT

* improve test coverage

* fix UT
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.0 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 size/L 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[edit dataset modal] After changing database, columns are not sync and require manual resync
5 participants