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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to