msyavuz commented on code in PR #42472:
URL: https://github.com/apache/superset/pull/42472#discussion_r3656450852


##########
superset/subjects/utils.py:
##########
@@ -176,6 +241,26 @@ def get_or_create_role_subject(role_id: int) -> Subject | 
None:
     return get_role_subject(role_id)
 
 
+def subjects_from_groups(groups: list[Group | int]) -> list[Subject]:
+    """Convert a list of Group objects or group IDs to GROUP-type Subjects.
+
+    Mirrors :func:`subjects_from_roles`, but resolves the whole list in one
+    query rather than one per group. Silently skips groups without a matching
+    Subject row.

Review Comment:
   Silently skipping groups with no Subject row — should this get-or-create 
like `get_or_create_role_subject` does? Same gap in the 
`get_user_group_subjects` path above: a partial viewer set is worse than none, 
since any viewer disables the dataset-access fallback while the unsynced group 
stays locked out.



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