You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2025/08/23 17:00:32 UTC

(airflow) branch v3-0-test updated: [v3-0-test] Point deprecation warning in Variable methods to specific alternatives (#54869) (#54871)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch v3-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-0-test by this push:
     new a8aa67f38d2 [v3-0-test] Point deprecation warning in Variable methods to specific alternatives (#54869) (#54871)
a8aa67f38d2 is described below

commit a8aa67f38d2be9aa2b1df41eb3a9f52ed08cecfb
Author: github-actions[bot] <41...@users.noreply.github.com>
AuthorDate: Sat Aug 23 19:00:24 2025 +0200

    [v3-0-test] Point deprecation warning in Variable methods to specific alternatives (#54869) (#54871)
    
    (cherry picked from commit bdb7e5147e86d69dd02c6eef59fdc8ad2d37f42e)
    
    Co-authored-by: Amogh Desai <am...@gmail.com>
---
 airflow-core/src/airflow/models/variable.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/airflow-core/src/airflow/models/variable.py b/airflow-core/src/airflow/models/variable.py
index 5cf9538aa8e..6123b019422 100644
--- a/airflow-core/src/airflow/models/variable.py
+++ b/airflow-core/src/airflow/models/variable.py
@@ -146,7 +146,7 @@ class Variable(Base, LoggingMixin):
         if hasattr(sys.modules.get("airflow.sdk.execution_time.task_runner"), "SUPERVISOR_COMMS"):
             warnings.warn(
                 "Using Variable.get from `airflow.models` is deprecated."
-                "Please use `from airflow.sdk import Variable` instead",
+                "Please use `get` on Variable from sdk(`airflow.sdk.Variable`) instead",
                 DeprecationWarning,
                 stacklevel=1,
             )
@@ -203,7 +203,7 @@ class Variable(Base, LoggingMixin):
         if hasattr(sys.modules.get("airflow.sdk.execution_time.task_runner"), "SUPERVISOR_COMMS"):
             warnings.warn(
                 "Using Variable.set from `airflow.models` is deprecated."
-                "Please use `from airflow.sdk import Variable` instead",
+                "Please use `set` on Variable from sdk(`airflow.sdk.Variable`) instead",
                 DeprecationWarning,
                 stacklevel=1,
             )
@@ -263,7 +263,7 @@ class Variable(Base, LoggingMixin):
         if hasattr(sys.modules.get("airflow.sdk.execution_time.task_runner"), "SUPERVISOR_COMMS"):
             warnings.warn(
                 "Using Variable.update from `airflow.models` is deprecated."
-                "Please use `from airflow.sdk import Variable` instead and use `Variable.set` as it is an upsert.",
+                "Please use `set` on Variable from sdk(`airflow.sdk.Variable`) instead as it is an upsert.",
                 DeprecationWarning,
                 stacklevel=1,
             )
@@ -318,7 +318,7 @@ class Variable(Base, LoggingMixin):
         if hasattr(sys.modules.get("airflow.sdk.execution_time.task_runner"), "SUPERVISOR_COMMS"):
             warnings.warn(
                 "Using Variable.delete from `airflow.models` is deprecated."
-                "Please use `from airflow.sdk import Variable` instead",
+                "Please use `delete` on Variable from sdk(`airflow.sdk.Variable`) instead",
                 DeprecationWarning,
                 stacklevel=1,
             )