jedcunningham commented on code in PR #40846:
URL: https://github.com/apache/airflow/pull/40846#discussion_r1684363093


##########
airflow/models/taskinstancehistory.py:
##########
@@ -44,8 +64,76 @@ class TaskInstanceHistory(Base):
     dag_id = Column(StringID(), nullable=False)
     run_id = Column(StringID(), nullable=False)
     map_index = Column(Integer, nullable=False, server_default=text("-1"))
-    try_number = Column(Integer, nullable=False)
-    # The rest of the columns are kept in sync with TaskInstance, added at the 
bottom of this file
+    start_date = Column(UtcDateTime)
+    end_date = Column(UtcDateTime)
+    duration = Column(Float)
+    state = Column(String(20))
+    try_number = Column(Integer, default=0)
+    max_tries = Column(Integer, server_default=text("-1"))
+    hostname = Column(String(1000))
+    unixname = Column(String(1000))
+    job_id = Column(Integer)
+    pool = Column(String(256), nullable=False)
+    pool_slots = Column(Integer, default=1, nullable=False)
+    queue = Column(String(256))
+    priority_weight = Column(Integer)
+    operator = Column(String(1000))
+    custom_operator_name = Column(String(1000))
+    queued_dttm = Column(UtcDateTime)
+    queued_by_job_id = Column(Integer)
+    pid = Column(Integer)
+    executor = Column(String(1000))
+    executor_config = Column(ExecutorConfigType(pickler=dill))
+    updated_at = Column(UtcDateTime, default=timezone.utcnow, 
onupdate=timezone.utcnow)
+    rendered_map_index = Column(String(250))
+
+    external_executor_id = Column(StringID())
+    trigger_id = Column(Integer)
+    trigger_timeout = Column(DateTime)
+    next_method = Column(String(1000))
+    next_kwargs = Column(MutableDict.as_mutable(ExtendedJSON))
+
+    _task_display_property_value = Column("task_display_name", String(2000), 
nullable=True)
+
+    dag_run = relationship(

Review Comment:
   It's more that even having these in the api response at all is a bit 
misleading. It sorta implies they can vary by try, but they can't. It's 
especially problematic for things to RTIF because they _do_ vary by try but we 
don't track it. And if we remove these things from the response, we no longer 
need these relationships on the model.



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