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: actually write changes on "superset import-datasources" #14817

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

regisb
Copy link
Contributor

@regisb regisb commented May 25, 2021

SUMMARY

When running the following command:

superset import-datasources --path=datasource.json

the data stored in "datasources.json" may either be dict or a list. In the case
of a dataset exported from a live superset instance, it is a list. When it is
re-imported, the SqlaTable.import_from_dict utility method is used. This
method does not commit changes to the database, so the imported datasets are
never saved to the database, causing frustration and sadness.

TESTING INSTRUCTIONS

  1. Create and export dataset
  2. Change the name of the dataset in the exported file
  3. Re-import dataset

Prior to the fix, the new dataset is not created.

ADDITIONAL INFORMATION

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

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

@stale stale bot added the inactive Inactive for >= 30 days label Apr 16, 2022
@regisb
Copy link
Contributor Author

regisb commented Apr 18, 2022

Auto-closing a PR without a single comment or feedback from project maintainers in a year? Come on, that's not very nice. Is it because the importer migrated to v1? As far as I know, the issue that this PR resolves is still present in importer v0.

@stale stale bot removed the inactive Inactive for >= 30 days label Apr 18, 2022
@rusackas rusackas requested review from villebro and eschutho March 9, 2023 18:42
@rusackas
Copy link
Member

I see this PR is still open (despite StaleBot's empty threats). Obviously, this has been sitting around for a long while, which I also apologize for... please advise on whether or not this is still important to merge, and maybe we can finally get it that review.

@regisb regisb force-pushed the regisb/fix-import-datasources branch from e19a8e9 to 1cd278a Compare May 22, 2023 13:03
@regisb
Copy link
Contributor Author

regisb commented May 22, 2023

Thanks for the response @rusackas. At the time, the PR did seem important. I'm not so sure that it is still important, but I'm pretty sure that the bug is still there. So I would suggest to merge this PR.

When running the following command:

    superset import-datasources --path=datasource.json

the data stored in "datasources.json" may either be dict or a list. In the case
of a dataset exported from a live superset instance, it is a list. When it is
re-imported, the `SqlaTable.import_from_dict` utility method is used. This
method does not commit changes to the database, so the imported datasets are
never saved to the database, causing frustration and sadness.
@regisb regisb force-pushed the regisb/fix-import-datasources branch from fdc4b8c to 2e1e0f6 Compare June 24, 2024 13:59
@regisb
Copy link
Contributor Author

regisb commented Jun 24, 2024

Rebased on top of master. I'm still hoping this will be merged in 2024 😛

@rusackas
Copy link
Member

Running CI 🤞 Here's hoping it'll turn green :D

Copy link

codecov bot commented Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.75%. Comparing base (76d897e) to head (2e1e0f6).
Report is 1094 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #14817       +/-   ##
===========================================
+ Coverage   60.48%   83.75%   +23.26%     
===========================================
  Files        1931      518     -1413     
  Lines       76236    37624    -38612     
  Branches     8568        0     -8568     
===========================================
- Hits        46114    31512    -14602     
+ Misses      28017     6112    -21905     
+ Partials     2105        0     -2105     
Flag Coverage Δ
hive 48.90% <0.00%> (-0.26%) ⬇️
javascript ?
mysql 77.27% <100.00%> (?)
postgres 77.40% <100.00%> (?)
presto 53.51% <0.00%> (-0.30%) ⬇️
python 83.75% <100.00%> (+20.26%) ⬆️
sqlite 76.85% <100.00%> (?)
unit 59.20% <0.00%> (+1.58%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@regisb
Copy link
Contributor Author

regisb commented Jun 25, 2024

Unfortunately I no longer have time to setup a dev environment for Superset, and thus I am unable to add unit tests to this PR.

@rusackas rusackas merged commit 5ffa616 into apache:master Jun 25, 2024
37 checks passed
@regisb regisb deleted the regisb/fix-import-datasources branch June 26, 2024 04:31
@regisb
Copy link
Contributor Author

regisb commented Jun 26, 2024

Thanks for merging this PR!

@rusackas
Copy link
Member

Thanks for the PR! Sorry it took approximately forever. We won't the next one slip through the cracks, I promise ;)

@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 4.1.0 labels Nov 27, 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/XS 🚢 4.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants