You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "john-bodley (via GitHub)" <gi...@apache.org> on 2023/08/09 21:28:49 UTC
[GitHub] [superset] john-bodley opened a new pull request, #24938: chore: Add explicit ON DELETE CASCADE for dashboard_slices
john-bodley opened a new pull request, #24938:
URL: https://github.com/apache/superset/pull/24938
<!---
Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
Example:
fix(dashboard): load charts correctly
-->
### SUMMARY
Somewhat akin to https://github.com/apache/superset/pull/24628, this PR ensures explicit ON DELETE CASCADE operations are set for the `dashboard_slices` table which means these don't need to be explicitly deleted in the SQLAlchemy ORM when deleting a dashboard.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
### TESTING INSTRUCTIONS
CI.
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [x] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [x] Migration is atomic, supports rollback & is backwards-compatible
- [x] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] michael-s-molina merged pull request #24938: chore: Add explicit ON DELETE CASCADE for dashboard_slices
Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina merged PR #24938:
URL: https://github.com/apache/superset/pull/24938
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] codecov[bot] commented on pull request #24938: chore: Add explicit ON DELETE CASCADE for dashboard_slices
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #24938:
URL: https://github.com/apache/superset/pull/24938#issuecomment-1672188129
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/24938?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
> Merging [#24938](https://app.codecov.io/gh/apache/superset/pull/24938?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (52caa1a) into [master](https://app.codecov.io/gh/apache/superset/commit/f6c3f0cbbb820b26ac9dc2f24832d59092a22f53?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (f6c3f0c) will **decrease** coverage by `10.68%`.
> The diff coverage is `n/a`.
> :exclamation: Current head 52caa1a differs from pull request most recent head b3fc170. Consider uploading reports for the commit b3fc170 to get more accurate results
```diff
@@ Coverage Diff @@
## master #24938 +/- ##
===========================================
- Coverage 69.00% 58.32% -10.68%
===========================================
Files 1906 1906
Lines 74145 74144 -1
Branches 8208 8208
===========================================
- Hits 51161 43245 -7916
- Misses 20861 28776 +7915
Partials 2123 2123
```
| Flag | Coverage Δ | |
|---|---|---|
| hive | `?` | |
| mysql | `?` | |
| postgres | `?` | |
| presto | `54.07% <ø> (+<0.01%)` | :arrow_up: |
| python | `61.04% <ø> (-22.33%)` | :arrow_down: |
| sqlite | `?` | |
| unit | `55.04% <ø> (+<0.01%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Files Changed](https://app.codecov.io/gh/apache/superset/pull/24938?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [superset/daos/dashboard.py](https://app.codecov.io/gh/apache/superset/pull/24938?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvZGFvcy9kYXNoYm9hcmQucHk=) | `35.18% <ø> (-61.59%)` | :arrow_down: |
... and [293 files with indirect coverage changes](https://app.codecov.io/gh/apache/superset/pull/24938/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] john-bodley commented on a diff in pull request #24938: chore: Add explicit ON DELETE CASCADE for dashboard_slices
Posted by "john-bodley (via GitHub)" <gi...@apache.org>.
john-bodley commented on code in PR #24938:
URL: https://github.com/apache/superset/pull/24938#discussion_r1289266015
##########
tests/integration_tests/dashboard_tests.py:
##########
@@ -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 = []
Review Comment:
My default this is an empty list.
##########
tests/integration_tests/security/guest_token_security_tests.py:
##########
@@ -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 = []
Review Comment:
See previous.
##########
tests/integration_tests/dashboard_tests.py:
##########
@@ -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 = []
hidden_dash = Dashboard()
hidden_dash.dashboard_title = "Not My Dashboard"
hidden_dash.slug = not_my_dash_slug
- hidden_dash.slices = []
Review Comment:
See previous.
##########
tests/integration_tests/dashboard_tests.py:
##########
@@ -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 = []
Review Comment:
See previous.
##########
superset/daos/dashboard.py:
##########
@@ -195,11 +195,6 @@ def update_charts_owners(model: Dashboard, commit: bool = True) -> Dashboard:
@classmethod
def delete(cls, items: Dashboard | list[Dashboard], commit: bool = True) -> None:
item_ids = [item.id for item in get_iterable(items)]
- # bulk delete, first delete related data
- for item in get_iterable(items):
- item.slices = []
- item.embedded = []
Review Comment:
This doesn't seem necessary per the way the [relationship is defined](https://github.com/apache/superset/blob/master/superset/models/dashboard.py#L166-L170).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] john-bodley commented on a diff in pull request #24938: chore: Add explicit ON DELETE CASCADE for dashboard_slices
Posted by "john-bodley (via GitHub)" <gi...@apache.org>.
john-bodley commented on code in PR #24938:
URL: https://github.com/apache/superset/pull/24938#discussion_r1289266952
##########
superset/daos/dashboard.py:
##########
@@ -195,11 +195,6 @@ def update_charts_owners(model: Dashboard, commit: bool = True) -> Dashboard:
@classmethod
def delete(cls, items: Dashboard | list[Dashboard], commit: bool = True) -> None:
item_ids = [item.id for item in get_iterable(items)]
- # bulk delete, first delete related data
- for item in get_iterable(items):
- item.slices = []
- item.embedded = []
Review Comment:
This doesn't seem necessary per the way the [relationship is defined](https://github.com/apache/superset/blob/master/superset/models/dashboard.py#L166-L170).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org