xchwan commented on code in PR #76583:
URL: https://github.com/apache/airflow/pull/76583#discussion_r4509351994


##########
airflow-core/src/airflow/api_fastapi/core_api/security.py:
##########
@@ -648,7 +651,9 @@ async def inner(
                 )
             # Select the id alongside dag_id: a NULL dag_id and a missing row 
both come back
             # as None from a bare ``Log.dag_id`` scalar, and they authorize 
differently.
-            row = session.execute(select(Log.id, Log.dag_id).where(Log.id == 
event_log_id)).one_or_none()
+            row = (
+                await session.execute(select(Log.id, Log.dag_id).where(Log.id 
== event_log_id))

Review Comment:
   Thanks for the reviews. I'll wait until #76493 is merged, then rebase and 
apply the same approach here (`get_team_name_async` + `DagDetails`, keeping the 
`_get_dag_id_from_request` fallback), since its final shape isn't settled and 
changing this now risks conflicts or rework.
   
   On a shared `_authorize_dag_async` helper: going through #76425, only 
`requires_access_backfill` and `requires_access_event_log` share this tail, so 
for two call sites I'd hold off. It makes more sense once more async 
dependencies need it, and I'm happy to extract it then.
   
   I'll also add a route test with a `Log` row that has a `dag_id`.
   
   ---
   Generated-by: Claude Code (Sonnet 5.5)



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