Fokko commented on a change in pull request #6370: AIRFLOW-5701: Don't clear 
xcom explicitly before execution
URL: https://github.com/apache/airflow/pull/6370#discussion_r339330555
 
 

 ##########
 File path: airflow/models/xcom.py
 ##########
 @@ -43,16 +43,14 @@ class XCom(Base, LoggingMixin):
     """
     __tablename__ = "xcom"
 
-    id = Column(Integer, primary_key=True)
-    key = Column(String(512))
+    key = Column(String(512), primary_key=True, nullable=False)
     value = Column(LargeBinary)
-    timestamp = Column(
-        UtcDateTime, default=timezone.utcnow, nullable=False)
-    execution_date = Column(UtcDateTime, nullable=False)
+    timestamp = Column(UtcDateTime, default=timezone.utcnow, nullable=False)
+    execution_date = Column(UtcDateTime, primary_key=True, nullable=False)
 
     # source information
-    task_id = Column(String(ID_LEN), nullable=False)
-    dag_id = Column(String(ID_LEN), nullable=False)
+    task_id = Column(String(ID_LEN), primary_key=True, nullable=False)
+    dag_id = Column(String(ID_LEN), primary_key=True, nullable=False)
 
     __table_args__ = (
         Index('idx_xcom_dag_task_date', dag_id, task_id, execution_date, 
unique=False),
 
 Review comment:
   Thanks for pointing this out @dstandish. This is indeed an issue. Could you 
create a ticket for this? And include the stack trace and how to reproduce 
this? That would be very helpful. Thanks 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to