vincbeck commented on code in PR #55954:
URL: https://github.com/apache/airflow/pull/55954#discussion_r2382965964


##########
airflow-core/src/airflow/models/taskinstancehistory.py:
##########
@@ -64,48 +64,48 @@ class TaskInstanceHistory(Base):
     """
 
     __tablename__ = "task_instance_history"
-    task_instance_id = Column(
+    task_instance_id = mapped_column(
         String(36).with_variant(postgresql.UUID(as_uuid=False), "postgresql"),
         nullable=False,
         primary_key=True,
     )
-    task_id = Column(StringID(), nullable=False)
-    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)
-    start_date = Column(UtcDateTime)
-    end_date = Column(UtcDateTime)
-    duration = Column(Float)
-    state = Column(String(20))
-    max_tries = Column(Integer, server_default=text("-1"))
-    hostname = Column(String(1000))
-    unixname = Column(String(1000))
-    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)
-    scheduled_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))
-    context_carrier = Column(MutableDict.as_mutable(ExtendedJSON))
-    span_status = Column(String(250), server_default=SpanStatus.NOT_STARTED, 
nullable=False)
-
-    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_name = Column(String(2000), nullable=True)
-    dag_version_id = Column(UUIDType(binary=False))
+    task_id = mapped_column(StringID(), nullable=False)
+    dag_id = mapped_column(StringID(), nullable=False)
+    run_id = mapped_column(StringID(), nullable=False)
+    map_index = mapped_column(Integer, nullable=False, 
server_default=text("-1"))
+    try_number = mapped_column(Integer, nullable=False)
+    start_date = mapped_column(UtcDateTime)
+    end_date = mapped_column(UtcDateTime)
+    duration = mapped_column(Float)
+    state = mapped_column(String(20))
+    max_tries = mapped_column(Integer, server_default=text("-1"))
+    hostname = mapped_column(String(1000))
+    unixname = mapped_column(String(1000))
+    pool = mapped_column(String(256), nullable=False)
+    pool_slots = mapped_column(Integer, default=1, nullable=False)
+    queue = mapped_column(String(256))
+    priority_weight = mapped_column(Integer)
+    operator = mapped_column(String(1000))
+    custom_operator_name = mapped_column(String(1000))
+    queued_dttm = mapped_column(UtcDateTime)
+    scheduled_dttm = mapped_column(UtcDateTime)
+    queued_by_job_id = mapped_column(Integer)
+    pid = mapped_column(Integer)
+    executor = mapped_column(String(1000))
+    executor_config = mapped_column(ExecutorConfigType(pickler=dill))
+    updated_at = mapped_column(UtcDateTime, default=timezone.utcnow, 
onupdate=timezone.utcnow)
+    rendered_map_index = mapped_column(String(250))
+    context_carrier = mapped_column(MutableDict.as_mutable(ExtendedJSON))
+    span_status = mapped_column(String(250), 
server_default=SpanStatus.NOT_STARTED, nullable=False)
+
+    external_executor_id = mapped_column(StringID())
+    trigger_id = mapped_column(Integer)
+    trigger_timeout = mapped_column(DateTime)
+    next_method = mapped_column(String(1000))
+    next_kwargs = mapped_column(MutableDict.as_mutable(ExtendedJSON))
+
+    task_display_name = mapped_column(String(2000), nullable=True)
+    dag_version_id = mapped_column(UUIDType(binary=False))

Review Comment:
   Added them



##########
airflow-core/src/airflow/models/renderedtifields.py:
##########
@@ -69,12 +69,12 @@ class RenderedTaskInstanceFields(TaskInstanceDependencies):
 
     __tablename__ = "rendered_task_instance_fields"
 
-    dag_id = Column(StringID(), primary_key=True)
-    task_id = Column(StringID(), primary_key=True)
-    run_id = Column(StringID(), primary_key=True)
-    map_index = Column(Integer, primary_key=True, server_default=text("-1"))
-    rendered_fields = Column(sqlalchemy_jsonfield.JSONField(json=json), 
nullable=False)
-    k8s_pod_yaml = Column(sqlalchemy_jsonfield.JSONField(json=json), 
nullable=True)
+    dag_id = mapped_column(StringID(), primary_key=True)
+    task_id = mapped_column(StringID(), primary_key=True)
+    run_id = mapped_column(StringID(), primary_key=True)
+    map_index = mapped_column(Integer, primary_key=True, 
server_default=text("-1"))
+    rendered_fields = mapped_column(sqlalchemy_jsonfield.JSONField(json=json), 
nullable=False)
+    k8s_pod_yaml = mapped_column(sqlalchemy_jsonfield.JSONField(json=json), 
nullable=True)

Review Comment:
   Added them



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