o-nikolas commented on code in PR #39531:
URL: https://github.com/apache/airflow/pull/39531#discussion_r1595860842


##########
airflow/jobs/scheduler_job_runner.py:
##########
@@ -1831,3 +1836,16 @@ def _orphan_unreferenced_datasets(self, session: Session 
= NEW_SESSION) -> None:
 
         updated_count = sum(self._set_orphaned(dataset) for dataset in 
orphaned_dataset_query)
         Stats.gauge("dataset.orphaned", updated_count)
+
+    def _executor_to_tis(self, tis: list[TaskInstance]) -> dict[BaseExecutor, 
list[TaskInstance]]:
+        """Organize TIs into lists per their respective executor."""
+        _executor_to_tis: defaultdict[BaseExecutor, list[TaskInstance]] = 
defaultdict(list)
+        executor: str | None
+        for ti in tis:
+            if ti.executor:
+                executor = str(ti.executor)
+            else:
+                executor = None

Review Comment:
   This bit of weirdness is just to make mypy types happy. The ti.executor 
field type comes up as a SQLA Column type, so if it's not None I cast to a 
string and if it's None I just make it None again (because mypy is stupid and 
harms my life).



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

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to