potiuk commented on a change in pull request #6596: [AIRFLOW-6004] Untangle 
Executors class to avoid cyclic imports
URL: https://github.com/apache/airflow/pull/6596#discussion_r351283485
 
 

 ##########
 File path: airflow/models/taskinstance.py
 ##########
 @@ -418,7 +421,7 @@ def error(self, session=None):
         session.commit()
 
     @provide_session
-    def refresh_from_db(self, session=None, lock_for_update=False, 
refresh_executor_config=False):
+    def refresh_from_db(self, session=None, lock_for_update=False, 
refresh_executor_config=False) -> None:
 
 Review comment:
   There is a subtle difference explained here: 
https://realpython.com/python-type-checking/#functions-without-return-values  
   
   If you specify -> None, then you will get warning if you try to assign 
return value to a variable. If you don't - you get no warning (None is still a 
valid return value that you can assign to something). So I started to add it 
(but not consistently, True). 
   I might review the changes and add -> None in all the affected non-return 
functions and try to do it in the future as well.
   
   WDYT @feluelle ?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to