You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/04/12 13:26:26 UTC

[GitHub] [airflow] potiuk commented on a diff in pull request #22944: fix trigger event payload is not persisted in db

potiuk commented on code in PR #22944:
URL: https://github.com/apache/airflow/pull/22944#discussion_r848435130


##########
airflow/models/trigger.py:
##########
@@ -115,7 +115,7 @@ def submit_event(cls, trigger_id, event, session=None):
             TaskInstance.trigger_id == trigger_id, TaskInstance.state == State.DEFERRED
         ):
             # Add the event's payload into the kwargs for the task
-            next_kwargs = task_instance.next_kwargs or {}
+            next_kwargs = dict(task_instance.next_kwargs) if task_instance.next_kwargs else {}

Review Comment:
   Seems that is indeed unfortunate way how some objects are treated by SQLAlchemy. Basically changes to object are not seen as "changes" unles we explicitly replace the object or mark it as changed.
   
   But likely there is a better way of handling it:
   
   https://docs.sqlalchemy.org/en/14/orm/extensions/mutable.html
   
   Seems that we could set the object as Mutable and it would solve the problem.



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