ccoliu commented on PR #71823:
URL: https://github.com/apache/airflow/pull/71823#issuecomment-5344499147

   > Interesting, but doing this would then prevent to change the ownership of 
a variable through the public API? We might need to differentiate the public 
API vs execution API path?
   
   Good catch! I checked the current implementation:
   1. **Public API `PATCH /variables/{key}`** and **Bulk Update**: Uses 
`update_orm_from_pydantic()` which directly sets ORM attributes — it does NOT 
go through `Variable.set()`, so changing `team_name` ownership via the REST API 
remains fully supported and is unaffected by this change.
   2. **Execution API `PUT /execution/variables/{key}`**: This is the 
task-execution path — it calls `Variable.set()` with the `team_name` 
automatically derived from the task's JWT token. Removing `team_name` from 
`update_fields` ensures that a task value-update won't implicitly overwrite the 
ownership of an existing global variable.
   3. **For new variables**: `team_name` remains in `upsert_values`, so initial 
ownership is correctly assigned when a variable is first created.
   
   So the boundary is already there — the only path that silently overwrites 
`team_name` was the `Variable.set()` upsert, which is primarily used by the 
Execution API path.


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