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


##########
task-sdk/src/airflow/sdk/types.py:
##########
@@ -124,6 +124,7 @@ class DagRunProtocol(Protocol):
     consumed_asset_events: list[AssetEventDagRunReference]
     partition_key: str | None
     note: str | None
+    team_name: str | None

Review Comment:
   Yeah, basically this was the cleanest way to plumb the team_name to the 
context on the worker side.
   
   > This feels like the wrong place to expose this. team_name is not a 
property of the dag run, but of the DAG.
   
   This isn't even true, I wish it was, but the community would not allow it to 
be a property of DAG or Task (or indeed DagRun) when designing the multi team 
feature. It is only a property of the Dag Bundle, everything else (Dag, Dag 
Run, task, etc) all just infer from Bundle.
   
   dag_run sub model on the TIRunContext already has conf, notes, 
triggering_user_name, etc and it was the closest thing that maps to team_name. 
And adding a whole new model just for team_name is way over kill. And there is 
already code that iterates over dag_run and exports the AIRFLOW_CTX_* env vars. 
   
   **tl;dr**: It was the closest match without adding hundreds of lines of code 
and new mechanisms just for team, this PR is just updating typing.



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