ephraimbuddy commented on code in PR #47459:
URL: https://github.com/apache/airflow/pull/47459#discussion_r1983749156
##########
airflow/models/taskreschedule.py:
##########
@@ -36,61 +44,31 @@
from airflow.models.taskinstance import TaskInstance
-class TaskReschedule(TaskInstanceDependencies):
+class TaskReschedule(Base):
"""TaskReschedule tracks rescheduled task instances."""
__tablename__ = "task_reschedule"
-
id = Column(Integer, primary_key=True)
- task_id = Column(String(ID_LEN, **COLLATION_ARGS), nullable=False)
- dag_id = Column(String(ID_LEN, **COLLATION_ARGS), nullable=False)
- run_id = Column(String(ID_LEN, **COLLATION_ARGS), nullable=False)
- map_index = Column(Integer, nullable=False, server_default=text("-1"))
+ ti_id = Column(
+ String(36).with_variant(postgresql.UUID(as_uuid=False), "postgresql"),
+ ForeignKey("task_instance.id", ondelete="CASCADE",
name="task_reschedule_ti_fkey"),
+ nullable=False,
+ )
try_number = Column(Integer, nullable=False)
start_date = Column(UtcDateTime, nullable=False)
end_date = Column(UtcDateTime, nullable=False)
duration = Column(Integer, nullable=False)
reschedule_date = Column(UtcDateTime, nullable=False)
- __table_args__ = (
- Index("idx_task_reschedule_dag_task_run", dag_id, task_id, run_id,
map_index, unique=False),
- ForeignKeyConstraint(
- [dag_id, task_id, run_id, map_index],
- [
- "task_instance.dag_id",
- "task_instance.task_id",
- "task_instance.run_id",
- "task_instance.map_index",
- ],
- name="task_reschedule_ti_fkey",
- ondelete="CASCADE",
- ),
- Index("idx_task_reschedule_dag_run", dag_id, run_id),
- ForeignKeyConstraint(
- [dag_id, run_id],
- ["dag_run.dag_id", "dag_run.run_id"],
- name="task_reschedule_dr_fkey",
- ondelete="CASCADE",
- ),
- )
- dag_run = relationship("DagRun")
- logical_date = association_proxy("dag_run", "logical_date")
Review Comment:
I didn't see where logical_date and dag_run were used. Would appreciate if
anyone could point me to the usage
--
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]