This is an automated email from the ASF dual-hosted git repository.

dstandish pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 2beb6a765d Simplify expression for get_permitted_dag_ids query (#42484)
2beb6a765d is described below

commit 2beb6a765d9af94115a7c010cfbc6f802d28da24
Author: Daniel Standish <[email protected]>
AuthorDate: Wed Sep 25 18:32:25 2024 -0700

    Simplify expression for get_permitted_dag_ids query (#42484)
---
 airflow/providers/fab/auth_manager/fab_auth_manager.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/airflow/providers/fab/auth_manager/fab_auth_manager.py 
b/airflow/providers/fab/auth_manager/fab_auth_manager.py
index 2de8db2f56..3d0f102650 100644
--- a/airflow/providers/fab/auth_manager/fab_auth_manager.py
+++ b/airflow/providers/fab/auth_manager/fab_auth_manager.py
@@ -342,10 +342,7 @@ class FabAuthManager(BaseAuthManager):
                         
resources.add(resource[len(permissions.RESOURCE_DAG_PREFIX) :])
                     else:
                         resources.add(resource)
-        return {
-            dag.dag_id
-            for dag in 
session.execute(select(DagModel.dag_id).where(DagModel.dag_id.in_(resources)))
-        }
+        return 
set(session.scalars(select(DagModel.dag_id).where(DagModel.dag_id.in_(resources))))
 
     @cached_property
     def security_manager(self) -> FabAirflowSecurityManagerOverride:

Reply via email to