You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "hussein-awala (via GitHub)" <gi...@apache.org> on 2023/09/09 08:33:13 UTC

[GitHub] [airflow] hussein-awala commented on a diff in pull request #34224: Add run_id to event logs API

hussein-awala commented on code in PR #34224:
URL: https://github.com/apache/airflow/pull/34224#discussion_r1320515753


##########
airflow/api_connexion/endpoints/event_log_endpoint.py:
##########
@@ -69,9 +69,11 @@ def get_event_logs(
         "execution_date",
         "owner",
         "extra",
+        "run_id",
     ]
     total_entries = session.scalars(func.count(Log.id)).one()
-    query = select(Log)
+    run_id_alias = aliased(Log)
+    query = select(Log, run_id_alias.run_id.label("run_id"))

Review Comment:
   I thought about avoiding adding a new column to Log and doing a join with DagRun to retrieve the run_id, but since we are discussing removing the run_date unique constraint, I think adding a new column is the best choice here.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org