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

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 881515b328b Change warning to RemovedInAirflow4Warning and remove 
redundant mock setup from test. (#72396)
881515b328b is described below

commit 881515b328b99dbb8fe01039f91c25a4c0057437
Author: SameerMesiah97 <[email protected]>
AuthorDate: Tue Sep 8 22:45:18 2026 +0100

    Change warning to RemovedInAirflow4Warning and remove redundant mock setup 
from test. (#72396)
    
    Co-authored-by: Sameer Mesiah <[email protected]>
---
 airflow-core/tests/unit/models/test_dagrun.py    | 5 +----
 task-sdk/src/airflow/sdk/definitions/deadline.py | 4 ++--
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/airflow-core/tests/unit/models/test_dagrun.py 
b/airflow-core/tests/unit/models/test_dagrun.py
index c30c1c7c94b..fbcb9cb8cef 100644
--- a/airflow-core/tests/unit/models/test_dagrun.py
+++ b/airflow-core/tests/unit/models/test_dagrun.py
@@ -1548,14 +1548,11 @@ class TestDagRun:
 
     @mock.patch.object(Deadline, "prune_deadlines")
     def test_dagrun_deadline_variable_interval_missing_variable_fails(self, _, 
session, deadline_test_dag):
-        mock_err = mock.Mock()
-        mock_err.error.value = "MISSING_DEADLINE"
-        mock_err.detail = "missing deadline"
 
         with mock.patch.object(
             Variable,
             "get",
-            side_effect=KeyError(mock_err),
+            side_effect=KeyError,
         ):
             future_date = datetime.datetime.now() + 
datetime.timedelta(days=365)
 
diff --git a/task-sdk/src/airflow/sdk/definitions/deadline.py 
b/task-sdk/src/airflow/sdk/definitions/deadline.py
index 4aabc493fb4..ba923868b44 100644
--- a/task-sdk/src/airflow/sdk/definitions/deadline.py
+++ b/task-sdk/src/airflow/sdk/definitions/deadline.py
@@ -27,7 +27,7 @@ import attrs
 
 from airflow.sdk.definitions.callback import AsyncCallback, Callback, 
SyncCallback
 from airflow.sdk.definitions.variable import Variable
-from airflow.sdk.exceptions import AirflowRuntimeError
+from airflow.sdk.exceptions import AirflowRuntimeError, 
RemovedInAirflow4Warning
 
 if TYPE_CHECKING:
     from collections.abc import Callable
@@ -442,7 +442,7 @@ class VariableInterval:
         warnings.warn(
             "VariableInterval.resolve() is deprecated and will be removed in a 
future release. "
             "Deadline interval resolution is handled internally during 
deadline evaluation.",
-            DeprecationWarning,
+            RemovedInAirflow4Warning,
             stacklevel=2,
         )
 

Reply via email to