sadpandajoe commented on code in PR #44256:
URL: https://github.com/apache/superset/pull/44256#discussion_r4044164885


##########
superset/dashboards/filters.py:
##########
@@ -220,13 +220,15 @@ def _apply_viewers(self, query: Query) -> Query:
                 and_(
                     Dashboard.published.is_(True),
                     ~dashboard_has_viewers,
+                   or_(
+                    ~Dashboard.slices.any(),

Review Comment:
   With `SOFT_DELETE` enabled, a dashboard whose charts have all been deleted 
still stays hidden: the outer join excludes deleted slices, but this `any()` 
EXISTS still sees them, so neither arm grants access. Could the emptiness check 
use the already-filtered outer join (for example, `Slice.id.is_(None)`) and 
cover the all-charts-soft-deleted case in a regression test?



-- 
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