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 2021/12/09 13:00:04 UTC

[GitHub] [airflow] kaxil commented on a change in pull request #20163: Mypy fixes to DagRun, TaskInstance, and db utils

kaxil commented on a change in pull request #20163:
URL: https://github.com/apache/airflow/pull/20163#discussion_r765765579



##########
File path: airflow/models/dagrun.py
##########
@@ -398,7 +398,9 @@ def generate_run_id(run_type: DagRunType, execution_date: datetime) -> str:
 
     @provide_session
     def get_task_instances(
-        self, state: Optional[Iterable[TaskInstanceState]] = None, session=None
+        self,
+        state: Optional[Iterable[Optional[TaskInstanceState]]] = None,
+        session: Session = NEW_SESSION,

Review comment:
       In a separate PR or this (your choice) - can you add a small section in https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#coding-style-and-best-practices to let devs know when they should use `NEW_SESSION` vs `Session` for type hints




-- 
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-unsubscribe@airflow.apache.org

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