diff --git a/tests/decorators/test_python.py b/tests/decorators/test_python.py index 5175c508ac56a3..1561b8224d740c 100644 --- a/tests/decorators/test_python.py +++ b/tests/decorators/test_python.py @@ -447,6 +447,7 @@ def return_dict(number: int): start_date=timezone.utcnow(), execution_date=DEFAULT_DATE, state=State.RUNNING, + data_interval=self.dag.timetable.infer_manual_data_interval(run_after=DEFAULT_DATE), ) ret.operator.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE) @@ -506,6 +507,7 @@ def add_num(number: int, num2: int = 2): start_date=timezone.utcnow(), execution_date=DEFAULT_DATE, state=State.RUNNING, + data_interval=self.dag.timetable.infer_manual_data_interval(run_after=DEFAULT_DATE), ) bigger_number.operator.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE) diff --git a/tests/decorators/test_python_virtualenv.py b/tests/decorators/test_python_virtualenv.py index aff442589e7ba8..15f37d9a46a911 100644 --- a/tests/decorators/test_python_virtualenv.py +++ b/tests/decorators/test_python_virtualenv.py @@ -32,7 +32,7 @@ pytestmark = pytest.mark.db_test DEFAULT_DATE = timezone.datetime(2016, 1, 1) -PYTHON_VERSION = sys.version_info[0] +PYTHON_VERSION = f"{sys.version_info.major}{sys.version_info.minor}" class TestPythonVirtualenvDecorator: @@ -252,7 +252,7 @@ def f(): ret.operator.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE) def test_python_3_cloudpickle(self, dag_maker): - @task.virtualenv(python_version=3, use_cloudpickle=False, requirements=["cloudpickle"]) + @task.virtualenv(python_version="3", use_cloudpickle=False, requirements=["cloudpickle"]) def f(): import sys @@ -269,7 +269,7 @@ def f(): ret.operator.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE) def test_python_3_dill(self, dag_maker): - @task.virtualenv(python_version=3, use_dill=False, requirements=["dill"]) + @task.virtualenv(python_version="3", use_dill=False, requirements=["dill"]) def f(): import sys diff --git a/tests/deprecations_ignore.yml b/tests/deprecations_ignore.yml index d54ba980f8045c..9e079963662692 100644 --- a/tests/deprecations_ignore.yml +++ b/tests/deprecations_ignore.yml @@ -194,17 +194,6 @@ - tests/operators/test_datetime.py::TestBranchDateTimeOperator::test_no_target_time - tests/operators/test_latest_only_operator.py::TestLatestOnlyOperator::test_not_skipping_external - tests/operators/test_latest_only_operator.py::TestLatestOnlyOperator::test_skipping_non_latest -- tests/operators/test_python.py::TestBranchOperator::test_clear_skipped_downstream_task -- tests/operators/test_python.py::TestBranchOperator::test_empty_branch -- tests/operators/test_python.py::TestBranchOperator::test_with_dag_run -- tests/operators/test_python.py::TestBranchOperator::test_with_skip_in_branch_downstream_dependencies -- tests/operators/test_python.py::TestBranchOperator::test_with_skip_in_branch_downstream_dependencies2 -- tests/operators/test_python.py::TestBranchOperator::test_xcom_push -- tests/operators/test_python.py::TestShortCircuitOperator::test_clear_skipped_downstream_task -- tests/operators/test_python.py::TestShortCircuitOperator::test_mapped_xcom_push_skipped_tasks -- tests/operators/test_python.py::TestShortCircuitOperator::test_short_circuiting -- tests/operators/test_python.py::TestShortCircuitOperator::test_xcom_push -- tests/operators/test_python.py::TestShortCircuitOperator::test_xcom_push_skipped_tasks - tests/operators/test_subdag_operator.py::TestSubDagOperator::test_execute_create_dagrun_wait_until_success - tests/operators/test_subdag_operator.py::TestSubDagOperator::test_execute_create_dagrun_with_conf - tests/operators/test_subdag_operator.py::TestSubDagOperator::test_execute_dagrun_failed @@ -237,31 +226,6 @@ - tests/operators/test_weekday.py::TestBranchDayOfWeekOperator::test_branch_xcom_push_true_branch -# BranchPythonVenv -- tests/operators/test_python.py::TestBranchPythonVirtualenvOperator::test_clear_skipped_downstream_task -- tests/operators/test_python.py::TestBranchPythonVirtualenvOperator::test_with_dag_run -- tests/operators/test_python.py::TestBranchPythonVirtualenvOperator::test_with_skip_in_branch_downstream_dependencies -- tests/operators/test_python.py::TestBranchPythonVirtualenvOperator::test_with_skip_in_branch_downstream_dependencies2 -- tests/operators/test_python.py::TestBranchPythonVirtualenvOperator::test_xcom_push - - -# BranchExternalPython -- tests/operators/test_python.py::TestBranchExternalPythonOperator::test_clear_skipped_downstream_task -- tests/operators/test_python.py::TestBranchExternalPythonOperator::test_with_dag_run -- tests/operators/test_python.py::TestBranchExternalPythonOperator::test_with_skip_in_branch_downstream_dependencies -- tests/operators/test_python.py::TestBranchExternalPythonOperator::test_with_skip_in_branch_downstream_dependencies2 -- tests/operators/test_python.py::TestBranchExternalPythonOperator::test_xcom_push - - -# PythonVenv -- tests/operators/test_python.py::TestPythonVirtualenvOperator::test_base_context -- tests/operators/test_python.py::TestPythonVirtualenvOperator::test_pendulum_context - - -# PlainAsserts -- tests/operators/test_python.py::TestPythonVirtualenvOperator::test_airflow_context - - # Serialization - tests/serialization/test_dag_serialization.py::TestStringifiedDAGs::test_custom_dep_detector - tests/serialization/test_dag_serialization.py::TestStringifiedDAGs::test_dag_params_roundtrip @@ -349,23 +313,8 @@ - tests/dag_processing/test_processor.py::TestDagFileProcessor::test_execute_on_failure_callbacks_without_dag - tests/dag_processing/test_processor.py::TestDagFileProcessor::test_failure_callbacks_should_not_drop_hostname - tests/dag_processing/test_processor.py::TestDagFileProcessor::test_process_file_should_failure_callback -- tests/decorators/test_python.py::TestAirflowTaskDecorator::test_fail_multiple_outputs_key_type -- tests/decorators/test_python.py::TestAirflowTaskDecorator::test_fail_multiple_outputs_no_dict -- tests/decorators/test_python.py::TestAirflowTaskDecorator::test_manual_multiple_outputs_false_with_typings -- tests/decorators/test_python.py::TestAirflowTaskDecorator::test_multiple_outputs -- tests/decorators/test_python.py::TestAirflowTaskDecorator::test_multiple_outputs_empty_dict -- tests/decorators/test_python.py::TestAirflowTaskDecorator::test_multiple_outputs_ignore_typing -- tests/decorators/test_python.py::TestAirflowTaskDecorator::test_multiple_outputs_return_none -- tests/decorators/test_python.py::TestAirflowTaskDecorator::test_python_callable_arguments_are_templatized -- tests/decorators/test_python.py::TestAirflowTaskDecorator::test_python_callable_keyword_arguments_are_templatized -- tests/decorators/test_python.py::TestAirflowTaskDecorator::test_xcom_arg +# Inlets/Outlets use TaskInstance.xcom_push() with deprecated arguments in airflow/lineage/__init__.py - tests/decorators/test_python.py::test_task_decorator_dataset -- tests/decorators/test_python_virtualenv.py::TestPythonVirtualenvDecorator::test_no_system_site_packages -- tests/decorators/test_python_virtualenv.py::TestPythonVirtualenvDecorator::test_python_3 -- tests/decorators/test_python_virtualenv.py::TestPythonVirtualenvDecorator::test_system_site_packages -- tests/decorators/test_python_virtualenv.py::TestPythonVirtualenvDecorator::test_unpinned_requirements -- tests/decorators/test_python_virtualenv.py::TestPythonVirtualenvDecorator::test_with_requirements_file -- tests/decorators/test_python_virtualenv.py::TestPythonVirtualenvDecorator::test_with_requirements_pinned - tests/lineage/test_lineage.py::TestLineage::test_lineage_is_sent_to_backend - tests/listeners/test_dataset_listener.py::test_dataset_listener_on_dataset_changed_gets_calls - tests/sensors/test_external_task_sensor.py::TestExternalTaskSensor::test_external_dag_sensor diff --git a/tests/operators/test_python.py b/tests/operators/test_python.py index cf9630d141f92d..795a5d40e69ed2 100644 --- a/tests/operators/test_python.py +++ b/tests/operators/test_python.py @@ -133,6 +133,7 @@ def create_dag_run(self) -> DagRun: session=self.dag_maker.session, execution_date=self.default_date, run_type=DagRunType.MANUAL, + data_interval=(self.default_date, self.default_date), ) def create_ti(self, fn, **kwargs) -> TI: