o-nikolas commented on code in PR #68108:
URL: https://github.com/apache/airflow/pull/68108#discussion_r3383789282
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -385,9 +386,11 @@ def _get_team_names_for_dag_ids(
self, dag_ids: Collection[str], session: Session
) -> dict[str, str | None]:
"""
- Batch query to resolve team names for multiple DAG IDs using the DAG >
Bundle > Team relationship chain.
+ Resolve team names for DAG IDs via the DAG → Bundle → Team
relationship.
Review Comment:
Nit: I actually prefer `>` over `→`, it's more universally renderable and
supported.
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -1714,6 +1729,7 @@ def _run_scheduler_loop(self) -> None:
idle_count = 0
for loop_count in itertools.count(start=1):
+ self._dag_id_to_team_name = {}
Review Comment:
Worth adding a comment explaining why this is reset each loop, or at least
that it is very intentional and important to keep this way.
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -716,6 +718,9 @@ def _executable_task_instances_to_queued(self, max_tis:
int, session: Session) -
len(unique_dag_ids),
list(unique_dag_ids),
)
+ for ti in task_instances_to_examine:
+ if team := dag_id_to_team_name.get(ti.dag_id):
+ ti._team_name = team
Review Comment:
Maybe worth noting in a comment for posterity that we have to do this
because the community refused to allow us to update the DB schema for TIs to
include team_name.
--
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]