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

chore: Add explicit ON DELETE CASCADE for dashboard_slices #24938

Conversation

john-bodley
Copy link
Member

@john-bodley john-bodley commented Aug 9, 2023

SUMMARY

Somewhat akin to #24628, this PR ensures explicit ON DELETE CASCADE operations are set for the dashboard_slices table which means these relationships don't need to be explicitly deleted for non-SQLAlchemy ORM operations.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

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

@john-bodley john-bodley requested a review from a team as a code owner August 9, 2023 21:28
@john-bodley john-bodley force-pushed the john-bodley--dashboard-slices-ondelete-cascade branch 2 times, most recently from dc79d04 to b3fc170 Compare August 9, 2023 21:35
@codecov
Copy link

codecov bot commented Aug 9, 2023

Codecov Report

Merging #24938 (405030d) into master (f6c3f0c) will decrease coverage by 0.01%.
Report is 1 commits behind head on master.
The diff coverage is n/a.

❗ Current head 405030d differs from pull request most recent head dc8dae0. Consider uploading reports for the commit dc8dae0 to get more accurate results

@@            Coverage Diff             @@
##           master   #24938      +/-   ##
==========================================
- Coverage   69.00%   69.00%   -0.01%     
==========================================
  Files        1906     1906              
  Lines       74147    74143       -4     
  Branches     8209     8209              
==========================================
- Hits        51166    51162       -4     
  Misses      20858    20858              
  Partials     2123     2123              
Flag Coverage Δ
hive 54.17% <ø> (+<0.01%) ⬆️
mysql 79.21% <ø> (-0.01%) ⬇️
postgres 79.31% <ø> (-0.01%) ⬇️
presto 54.07% <ø> (+<0.01%) ⬆️
python 83.37% <ø> (-0.01%) ⬇️
sqlite 77.89% <ø> (-0.01%) ⬇️
unit 55.05% <ø> (+<0.01%) ⬆️

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

Files Changed Coverage Δ
superset/daos/chart.py 92.30% <ø> (-0.42%) ⬇️
superset/daos/dashboard.py 96.75% <ø> (-0.02%) ⬇️
superset/models/dashboard.py 77.90% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@john-bodley john-bodley force-pushed the john-bodley--dashboard-slices-ondelete-cascade branch from b3fc170 to b7bb0dc Compare August 9, 2023 22:16
@@ -207,12 +207,10 @@ def test_users_can_view_own_dashboard(self):
dash.dashboard_title = "My Dashboard"
dash.slug = my_dash_slug
dash.owners = [user]
dash.slices = []
Copy link
Member Author

Choose a reason for hiding this comment

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

My default this is an empty list.


hidden_dash = Dashboard()
hidden_dash.dashboard_title = "Not My Dashboard"
hidden_dash.slug = not_my_dash_slug
hidden_dash.slices = []
Copy link
Member Author

Choose a reason for hiding this comment

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

See previous.

@@ -277,7 +275,6 @@ def test_user_can_not_view_unpublished_dash(self):
dash.dashboard_title = "My Dashboard"
dash.slug = slug
dash.owners = [admin_user]
dash.slices = []
Copy link
Member Author

Choose a reason for hiding this comment

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

See previous.

@@ -186,8 +186,6 @@ def test_raise_for_access_dashboard_as_guest_no_rbac(self):
# Create a draft dashboard that is not embedded
dash = Dashboard()
dash.dashboard_title = "My Dashboard"
dash.owners = []
dash.slices = []
Copy link
Member Author

Choose a reason for hiding this comment

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

See previous.

@john-bodley john-bodley force-pushed the john-bodley--dashboard-slices-ondelete-cascade branch from b7bb0dc to ed7f067 Compare August 9, 2023 22:33
@john-bodley john-bodley force-pushed the john-bodley--dashboard-slices-ondelete-cascade branch from ed7f067 to dc8dae0 Compare August 9, 2023 23:29
Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the improvement @john-bodley!

@michael-s-molina michael-s-molina merged commit 94c5950 into apache:master Aug 10, 2023
@michael-s-molina michael-s-molina added the v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch label Aug 10, 2023
@mistercrunch mistercrunch added 🍒 3.0.0 🍒 3.0.1 🍒 3.0.2 🍒 3.0.3 🍒 3.0.4 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.1.0 labels Mar 8, 2024
vinothkumar66 pushed a commit to vinothkumar66/superset that referenced this pull request Nov 11, 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/M v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch 🍒 3.0.0 🍒 3.0.1 🍒 3.0.2 🍒 3.0.3 🍒 3.0.4 🚢 3.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants