Taragolis commented on code in PR #39430:
URL: https://github.com/apache/airflow/pull/39430#discussion_r1609772250


##########
airflow/jobs/job.py:
##########
@@ -101,24 +95,18 @@ class Job(Base, LoggingMixin):
         Index("idx_job_dag_id", dag_id),
     )
 
-    task_instances_enqueued = relationship(
+    task_instances_enqueued = relationship(  # Task Instances which have been 
enqueued by this Job.
         "TaskInstance",
+        back_populates="queued_by_job",
         primaryjoin="Job.id == foreign(TaskInstance.queued_by_job_id)",
-        backref=backref("queued_by_job", uselist=False),
     )
 
-    dag_runs = relationship(
+    dag_runs = relationship(  # Only makes sense for SchedulerJob and 
BackfillJob instances.
         "DagRun",
-        primaryjoin=lambda: Job.id == 
foreign(_resolve_dagrun_model().creating_job_id),
-        backref="creating_job",
+        back_populates="creating_job",
+        primaryjoin="Job.id == foreign(DagRun.creating_job_id)",
     )
 
-    """
-    TaskInstances which have been enqueued by this Job.
-
-    Only makes sense for SchedulerJob and BackfillJob instances.
-    """
-

Review Comment:
   Oh... my bad. It already moved into the L104
   
https://github.com/apache/airflow/blob/9ed927a0cfdcc47e50a03bbbde50dcf991b7c15e/airflow/jobs/job.py#L104
   



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