This is an automated email from the ASF dual-hosted git repository.
vincbeck pushed a commit to branch v3-3-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-3-test by this push:
new 819f2c30fc8 [v3-3-test] Fix Variable.set rewriting team_name of
existing variables (#71823) (#71904)
819f2c30fc8 is described below
commit 819f2c30fc84afff96d944450f25ae2c371935c1
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Aug 20 12:58:04 2026 -0400
[v3-3-test] Fix Variable.set rewriting team_name of existing variables
(#71823) (#71904)
(cherry picked from commit 132ec4f59b8bc3b3795113ac6e5fc3d0f8d697a2)
Co-authored-by: ccoliu <[email protected]>
---
airflow-core/src/airflow/models/variable.py | 1 -
airflow-core/tests/unit/models/test_variable.py | 8 ++++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/airflow-core/src/airflow/models/variable.py
b/airflow-core/src/airflow/models/variable.py
index c366a2482b1..9493cab60aa 100644
--- a/airflow-core/src/airflow/models/variable.py
+++ b/airflow-core/src/airflow/models/variable.py
@@ -287,7 +287,6 @@ class Variable(Base, LoggingMixin):
val=val,
description=description,
is_encrypted=is_encrypted,
- team_name=team_name,
)
stmt = build_upsert_stmt(
get_dialect_name(session), Variable, ["key"], upsert_values,
update_fields
diff --git a/airflow-core/tests/unit/models/test_variable.py
b/airflow-core/tests/unit/models/test_variable.py
index 001a29a7c0c..0bc32373a30 100644
--- a/airflow-core/tests/unit/models/test_variable.py
+++ b/airflow-core/tests/unit/models/test_variable.py
@@ -369,6 +369,14 @@ class TestVariable:
finally:
session.rollback()
+ @conf_vars({("core", "multi_team"): "True"})
+ def test_variable_set_does_not_change_team_name_on_update(self,
testing_team, session):
+ Variable.set(key="k", value="v1", session=session)
+
+ Variable.set(key="k", value="v2", team_name=testing_team.name,
session=session)
+
+ assert Variable.get("k") == "v2"
+
@mock.patch("airflow.models.variable.ensure_secrets_loaded")
def test_caching_caches(self, mock_ensure_secrets: mock.Mock):
mock_backend = mock.Mock()