-
Notifications
You must be signed in to change notification settings - Fork 16.5k
chore(dao): Add explicit ON DELETE CASCADE for ownership #24628
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(dao): Add explicit ON DELETE CASCADE for ownership #24628
Conversation
superset/daos/report.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure why the reports were refetched as opposed to using the items provides. Note after removing the need to remove the owners this logic simply reduced to the BaseDAO.delete method and thus is unnecessary.
superset/examples/birth_names.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to initialize this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same logic as before, but using the more generalized shared constraints logic.
superset/tables/models.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using uppercase for consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Databases don't have owners so this line was a red herring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
38ca4e8 to
8e2b3d8
Compare
Codecov Report
@@ Coverage Diff @@
## master #24628 +/- ##
==========================================
+ Coverage 68.97% 69.05% +0.08%
==========================================
Files 1907 1908 +1
Lines 74153 74168 +15
Branches 8182 8177 -5
==========================================
+ Hits 51148 51219 +71
+ Misses 20882 20829 -53
+ Partials 2123 2120 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 8 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
8e2b3d8 to
a2f826b
Compare
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision = "6d05b0a70c89" | ||
| down_revision = "240d23c7f86f" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@john-bodley Use the latest f92a3124dd66 revision
Also update Create Date in filename in order to have this file after f92a3124dd66 in migrations/versions folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EugeneTorap I've updated the SHA. AFAIK we typically don't update the date associated with the filename, i.e., there's no guarantee that these revisions are in chronological order, i.e., they merely serves as a guide. cc @craig-rueda for guidance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say that updating the filename is fine. Ideally the filename would be somewhat close to the date that the PR is merged as to keep things somewhat sorted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
craig-rueda
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…_for_owners_references.py to 2023-07-11_15-51_6d05b0a70c89_add_on_delete_cascade_for_owners_references.py
SUMMARY
Per SIP-92 Proposal for restructuring the Python code base #24331 organized all the DAOs to be housed within a shared folder—the result of which highlighted numerous inconsistencies, repetition, and inefficiencies.
This PR is somewhat akin to #24488 where explicit
ON DELETE CASCADEoperations are set for the ownership associations.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
CI.
ADDITIONAL INFORMATION