uranusjr commented on code in PR #28900:
URL: https://github.com/apache/airflow/pull/28900#discussion_r1264177557


##########
airflow/models/dagrun.py:
##########
@@ -100,6 +102,29 @@ def _creator_note(val):
         return DagRunNote(*val)
 
 
+def _get_task_instance(

Review Comment:
   Why is this function needed? It seems to me this simply forward the 
arguments unchanged, and all caller sites can simply call 
`DagRun.fetch_task_instance`?



##########
airflow/models/dagrun.py:
##########
@@ -486,10 +515,25 @@ def get_task_instances(
                 else:
                     tis = tis.where(TI.state.in_(state))
 
-        if self.dag and self.dag.partial:
-            tis = tis.where(TI.task_id.in_(self.dag.task_ids))
+        if dag and dag.partial:
+            tis = tis.where(TI.task_id.in_(dag.task_ids))
         return session.scalars(tis).all()
 
+    @provide_session
+    def get_task_instances(
+        self,
+        state: Iterable[TaskInstanceState | None] | None = None,
+        session: Session = NEW_SESSION,
+    ) -> list[TI]:
+        """
+        Returns the task instances for this dag run.
+        Redirect to DagRun.fetch_task_instances method.
+        Keep this method because it is widely used across the code.
+        """

Review Comment:
   Please revise docstrings to conform to D205. 
http://www.pydocstyle.org/en/2.1.1/error_codes.html



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to