Skip to content

Commit

Permalink
Simplify expression for get_permitted_dag_ids query (apache#42484)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstandish authored Sep 26, 2024
1 parent 8e56206 commit 2beb6a7
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions airflow/providers/fab/auth_manager/fab_auth_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,7 @@ def get_permitted_dag_ids(
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:
Expand Down

0 comments on commit 2beb6a7

Please sign in to comment.