jmcarp commented on a change in pull request #4685: [AIRFLOW-3862] Check types 
with mypy.
URL: https://github.com/apache/airflow/pull/4685#discussion_r255769937
 
 

 ##########
 File path: airflow/models/__init__.py
 ##########
 @@ -1014,9 +1019,8 @@ def are_dependents_done(self, session=None):
         count = ti[0][0]
         return count == len(task.downstream_task_ids)
 
-    @property
     @provide_session
-    def previous_ti(self, session=None):
+    def get_previous_ti(self, session=None):
 
 Review comment:
   `mypy` raises an error when a property has arity >1 (which makes sense) or 
when a property is decorated (which might make less sense). I got around those 
errors by factoring those methods into a non-property that uses the 
`provide_session` decorator and takes a `session` argument and a property that 
invokes the non-property.
   
   Alternatively, we could ignore the `mypy` warnings and revert these changes, 
or not use the decorator here and explicitly create a session instead.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to