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

eladkal 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 feb8307472 Resolve deprecations in `LatestOnlyOperator` tests (#40181)
feb8307472 is described below

commit feb8307472b21cd33fcf0a6860f2f42205606af7
Author: Bora Berke Sahin <67373739+borabe...@users.noreply.github.com>
AuthorDate: Thu Jun 13 14:45:58 2024 +0300

    Resolve deprecations in `LatestOnlyOperator` tests (#40181)
    
    * Resolve deprecations in `LatestOnlyOperator`
    
    * Use explicit data_interval
---
 tests/deprecations_ignore.yml                | 4 ----
 tests/operators/test_latest_only_operator.py | 3 +++
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/tests/deprecations_ignore.yml b/tests/deprecations_ignore.yml
index ada879f9c9..b657e820f9 100644
--- a/tests/deprecations_ignore.yml
+++ b/tests/deprecations_ignore.yml
@@ -45,10 +45,6 @@
 - 
tests/ti_deps/deps/test_prev_dagrun_dep.py::TestPrevDagrunDep::test_first_task_run_of_new_task
 
 
-# Operators
-- 
tests/operators/test_latest_only_operator.py::TestLatestOnlyOperator::test_skipping_non_latest
-
-
 # Serialization
 - 
tests/serialization/test_dag_serialization.py::TestStringifiedDAGs::test_custom_dep_detector
 
diff --git a/tests/operators/test_latest_only_operator.py 
b/tests/operators/test_latest_only_operator.py
index 7bce02de95..e67463aea0 100644
--- a/tests/operators/test_latest_only_operator.py
+++ b/tests/operators/test_latest_only_operator.py
@@ -96,6 +96,7 @@ class TestLatestOnlyOperator:
             start_date=timezone.utcnow(),
             execution_date=DEFAULT_DATE,
             state=State.RUNNING,
+            data_interval=(DEFAULT_DATE, DEFAULT_DATE),
         )
 
         self.dag.create_dagrun(
@@ -103,6 +104,7 @@ class TestLatestOnlyOperator:
             start_date=timezone.utcnow(),
             execution_date=timezone.datetime(2016, 1, 1, 12),
             state=State.RUNNING,
+            data_interval=(timezone.datetime(2016, 1, 1, 12), 
timezone.datetime(2016, 1, 1, 12) + INTERVAL),
         )
 
         self.dag.create_dagrun(
@@ -110,6 +112,7 @@ class TestLatestOnlyOperator:
             start_date=timezone.utcnow(),
             execution_date=END_DATE,
             state=State.RUNNING,
+            data_interval=(END_DATE, END_DATE + INTERVAL),
         )
 
         latest_task.run(start_date=DEFAULT_DATE, end_date=END_DATE)

Reply via email to