uranusjr commented on a change in pull request #20011:
URL: https://github.com/apache/airflow/pull/20011#discussion_r762764645



##########
File path: airflow/models/xcom.py
##########
@@ -99,29 +137,63 @@ def set(cls, key, value, task_id, dag_id, 
execution_date=None, run_id=None, sess
 
         value = XCom.serialize_value(value)
 
-        # remove any duplicate XComs
+        # Remove duplicate XComs and insert a new one.
         session.query(cls).filter(
-            cls.key == key, cls.execution_date == execution_date, cls.task_id 
== task_id, cls.dag_id == dag_id
+            cls.key == key,
+            cls.execution_date == execution_date,
+            cls.task_id == task_id,
+            cls.dag_id == dag_id,
         ).delete()
-
+        new = cast(Any, cls)(  # Work around Mypy complaining model not 
defining '__init__'.
+            key=key,
+            value=cls.serialize_value(value),

Review comment:
       Ah I see, wrong copy-paste. I merged line 100/138 above to this in the 
other PR, but forgot to delete that line when copying the new implementation.




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