You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/08/24 09:23:28 UTC

[GitHub] [airflow] potiuk commented on a change in pull request #10499: Make models/taskinstance.py pylint compatible

potiuk commented on a change in pull request #10499:
URL: https://github.com/apache/airflow/pull/10499#discussion_r475457567



##########
File path: airflow/models/taskinstance.py
##########
@@ -1762,19 +1767,18 @@ def filter_for_tis(
         tis: Iterable[Union["TaskInstance", TaskInstanceKey]]
     ) -> Optional[BooleanClauseList]:
         """Returns SQLAlchemy filter to query selected task instances"""
-        TI = TaskInstance
         if not tis:
             return None
         if all(isinstance(t, TaskInstanceKey) for t in tis):
-            filter_for_tis = ([and_(TI.dag_id == tik.dag_id,
-                                    TI.task_id == tik.task_id,
-                                    TI.execution_date == tik.execution_date)
+            filter_for_tis = ([and_(TaskInstance.dag_id == tik.dag_id,
+                                    TaskInstance.task_id == tik.task_id,
+                                    TaskInstance.execution_date == tik.execution_date)
                                for tik in tis])
             return or_(*filter_for_tis)
         if all(isinstance(t, TaskInstance) for t in tis):
-            filter_for_tis = ([and_(TI.dag_id == ti.dag_id,
-                                    TI.task_id == ti.task_id,
-                                    TI.execution_date == ti.execution_date)
+            filter_for_tis = ([and_(TaskInstance.dag_id == ti.dag_id,
+                                    TaskInstance.task_id == ti.task_id,
+                                    TaskInstance.execution_date == ti.execution_date)

Review comment:
       > Is this another attempt to fix cyclic imports? #9674
   
   It was not supposed to be, but it turned out to be exactly this :). 




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

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