amoghrajesh commented on code in PR #45030:
URL: https://github.com/apache/airflow/pull/45030#discussion_r1890201012


##########
airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -216,6 +216,7 @@ def ti_update_state(
             kwargs=ti_patch_payload.trigger_kwargs,
         )
         session.add(trigger_row)
+        session.flush()

Review Comment:
   Only when i add the session.flush() here, it updates the `trigger` table. 
Even though we define our session dependency like this: 
   ```
   def _get_session() -> Session:
       with create_session(scoped=False) as session:
           yield session
   
   
   SessionDep = Annotated[Session, Depends(_get_session)]
   ```
   
   I am not sure why this is working, tried looking in few docs, but I cannot 
seem to find a better answer here. @kaxil @ashb any thoughts?



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