Skip to content

Commit

Permalink
Resolve core operators deprecations in tests (apache#40267)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirrao authored and romsharon98 committed Jul 26, 2024
1 parent 7da6ebf commit 0fda8fb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 0 additions & 3 deletions tests/deprecations_ignore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,9 @@


# Core
- tests/models/test_cleartasks.py::TestClearTasks::test_dags_clear
- tests/models/test_dagbag.py::TestDagBag::test_load_subdags
- tests/models/test_mappedoperator.py::test_expand_mapped_task_instance_with_named_index
- tests/models/test_skipmixin.py::TestSkipMixin::test_skip_none_dagrun
- tests/models/test_xcom.py::TestXCom::test_set_serialize_call_old_signature
- tests/ti_deps/deps/test_prev_dagrun_dep.py::TestPrevDagrunDep::test_first_task_run_of_new_task


# Serialization
Expand Down
1 change: 1 addition & 0 deletions tests/models/test_cleartasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ def test_dags_clear(self):
state=State.RUNNING,
run_type=DagRunType.SCHEDULED,
session=session,
data_interval=(DEFAULT_DATE, DEFAULT_DATE),
)
ti = dr.task_instances[0]
ti.task = task
Expand Down
5 changes: 4 additions & 1 deletion tests/ti_deps/deps/test_prev_dagrun_dep.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def test_first_task_run_of_new_task(self):
state=TaskInstanceState.SUCCESS,
execution_date=old_task.start_date,
run_type=DagRunType.SCHEDULED,
data_interval=(old_task.start_date, old_task.start_date),
)

new_task = BaseOperator(
Expand All @@ -67,11 +68,13 @@ def test_first_task_run_of_new_task(self):
)

# New DAG run will include 1st TaskInstance of new_task
execution_date = convert_to_utc(datetime(2016, 1, 2))
dr = dag.create_dagrun(
run_id="new_run",
state=DagRunState.RUNNING,
execution_date=convert_to_utc(datetime(2016, 1, 2)),
execution_date=execution_date,
run_type=DagRunType.SCHEDULED,
data_interval=(execution_date, execution_date),
)

ti = dr.get_task_instance(new_task.task_id)
Expand Down

0 comments on commit 0fda8fb

Please sign in to comment.