kolfild26 commented on code in PR #28998:
URL: https://github.com/apache/airflow/pull/28998#discussion_r1081624869


##########
airflow/api_connexion/endpoints/dag_run_endpoint.py:
##########
@@ -319,6 +330,19 @@ def post_dag_run(*, dag_id: str, session: Session = 
NEW_SESSION) -> APIResponse:
                 dag_hash=get_airflow_app().dag_bag.dags_hash.get(dag_id),
                 session=session,
             )
+            try:
+                to_log_data = {
+                    "event": "rest_dag_trigger",
+                    "owner": g.user.username,
+                    "extra": None,
+                    "task_id": None,
+                    "dag_id": f"{dag_run.dag_id}",

Review Comment:
   The point was to write the `log` table. To do so we first need to create 
_Log_ object. That's what we actually do here.
   We don't write to `dag_run` table, thus cannot use _DagRun_ object as itself.
   And also, owner is only accessible from `flask.g`.
   So we need to "construct" _Log_ object



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