Tegh25 commented on code in PR #70416:
URL: https://github.com/apache/airflow/pull/70416#discussion_r3763445146


##########
airflow-core/src/airflow/jobs/triggerer_job_runner.py:
##########
@@ -213,6 +213,8 @@ def __init__(
             raise ValueError(f"Capacity number {capacity!r} is invalid")
         self.queues = queues
         self.team_name = team_name
+        if job.team_name is None:
+            job.team_name = team_name

Review Comment:
   Only one case I can think of, the `if job.team_name is None` branch covers 
callers that construct a bare `Job()` and only pass `team_name` into the 
runner, which is something some of the tests do.
   
   Looking at it now, `self.team_name` is redundant if we treat `job.team_name` 
as the source of truth. If we want to keep the constructor arg, we can set 
`job.team_name = team_name` indefinitely. Or we drop the constructor arg and 
require callers to set `team_name` on Job.
   
   Which resolution do you prefer, and would removing `self.team_name` be in 
the scope of this PR?



-- 
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