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: can't trigger delete event on SqlaTable #19752

Closed
wants to merge 5 commits into from

Conversation

zhaoyongjie
Copy link
Member

@zhaoyongjie zhaoyongjie commented Apr 18, 2022

SUMMARY

The SqlaTable model can't remove associative sl_tables when triggering delete event.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

CI

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

@codecov
Copy link

codecov bot commented Apr 18, 2022

Codecov Report

Merging #19752 (00b6d79) into master (57157c8) will decrease coverage by 12.83%.
The diff coverage is 61.11%.

❗ Current head 00b6d79 differs from pull request most recent head 60d1900. Consider uploading reports for the commit 60d1900 to get more accurate results

@@             Coverage Diff             @@
##           master   #19752       +/-   ##
===========================================
- Coverage   66.51%   53.67%   -12.84%     
===========================================
  Files        1687     1689        +2     
  Lines       64620    64632       +12     
  Branches     6646     6649        +3     
===========================================
- Hits        42980    34691     -8289     
- Misses      19940    28238     +8298     
- Partials     1700     1703        +3     
Flag Coverage Δ
hive ?
mysql ?
postgres ?
presto 52.54% <100.00%> (+<0.01%) ⬆️
python 56.25% <100.00%> (-26.18%) ⬇️
sqlite ?
unit 47.76% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
superset/key_value/shared_entries.py 45.00% <ø> (-55.00%) ⬇️
superset/reports/api.py 58.59% <ø> (-31.25%) ⬇️
...perset-frontend/src/views/CRUD/alert/AlertList.tsx 65.30% <33.33%> (-1.37%) ⬇️
...frontend/src/components/ImportModal/ErrorAlert.tsx 40.00% <40.00%> (ø)
...rset-frontend/src/components/ImportModal/index.tsx 73.17% <50.00%> (+0.67%) ⬆️
...rset-frontend/src/components/ImportModal/styles.ts 100.00% <100.00%> (ø)
superset/connectors/sqla/models.py 76.20% <100.00%> (-13.26%) ⬇️
superset/datasets/models.py 100.00% <100.00%> (ø)
superset/utils/dashboard_import_export.py 0.00% <0.00%> (-100.00%) ⬇️
superset/key_value/commands/upsert.py 0.00% <0.00%> (-89.59%) ⬇️
... and 276 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 57157c8...60d1900. Read the comment docs.

@zhaoyongjie zhaoyongjie changed the title fix: can't tigger delete in old model fix: can't tigger delete event on SqlaTable Apr 19, 2022
@@ -250,6 +250,7 @@ def test_import_v0_dataset_cli_export(self):
}
command = v0.ImportDatasetsCommand(contents)
command.run()
db.session.commit()
Copy link
Member Author

@zhaoyongjie zhaoyongjie Apr 19, 2022

Choose a reason for hiding this comment

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

It's a flaky test here. The after_insert in the SqlaTable doesn't run commit finally, so the Postgresql probably does not immediately preserve shadow tables.

@@ -290,6 +291,7 @@ def test_import_v0_dataset_ui_export(self):
}
command = v0.ImportDatasetsCommand(contents)
command.run()
db.session.commit()
Copy link
Member Author

Choose a reason for hiding this comment

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

same before

@zhaoyongjie zhaoyongjie changed the title fix: can't tigger delete event on SqlaTable fix: can't trigger delete event on SqlaTable Apr 19, 2022
@zhaoyongjie
Copy link
Member Author

zhaoyongjie commented Apr 20, 2022

this issue has been fixed by #19421, so closed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant