jedcunningham commented on code in PR #30116:
URL: https://github.com/apache/airflow/pull/30116#discussion_r1140470706


##########
airflow/models/dagbag.py:
##########
@@ -688,10 +688,10 @@ def _sync_perm_for_dag(cls, dag: DAG, session: Session = 
NEW_SESSION):
 
         root_dag_id = dag.parent_dag.dag_id if dag.parent_dag else dag.dag_id
 
-        def needs_perms(dag_id: str) -> bool:
+        def has_perms(dag_id: str) -> bool:

Review Comment:
   It's more efficient to see if you need perms, as you can short circuit out 
on the first miss.
   
   This, as written, is wrong because you don't check that a perm exists for 
everything in DAG_ACTIONS.



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

Reply via email to