diff --git a/airflow/example_dags/example_branch_datetime_operator.py b/airflow/example_dags/example_branch_datetime_operator.py index e5aaa592cd16..99645b9c9eb0 100644 --- a/airflow/example_dags/example_branch_datetime_operator.py +++ b/airflow/example_dags/example_branch_datetime_operator.py @@ -26,7 +26,7 @@ from airflow.models.dag import DAG from airflow.operators.empty import EmptyOperator -from airflow.providers.standard.time.operators.datetime import BranchDateTimeOperator +from airflow.providers.standard.operators.datetime import BranchDateTimeOperator dag1 = DAG( dag_id="example_branch_datetime_operator", diff --git a/airflow/example_dags/example_branch_day_of_week_operator.py b/airflow/example_dags/example_branch_day_of_week_operator.py index ef7caf9cdce7..b7eed08acdf4 100644 --- a/airflow/example_dags/example_branch_day_of_week_operator.py +++ b/airflow/example_dags/example_branch_day_of_week_operator.py @@ -25,7 +25,7 @@ from airflow.models.dag import DAG from airflow.operators.empty import EmptyOperator -from airflow.providers.standard.time.operators.weekday import BranchDayOfWeekOperator +from airflow.providers.standard.operators.weekday import BranchDayOfWeekOperator from airflow.utils.weekday import WeekDay with DAG( diff --git a/airflow/example_dags/example_sensors.py b/airflow/example_dags/example_sensors.py index 9889695ab392..6fb564e63ae4 100644 --- a/airflow/example_dags/example_sensors.py +++ b/airflow/example_dags/example_sensors.py @@ -23,9 +23,9 @@ from airflow.models.dag import DAG from airflow.operators.bash import BashOperator -from airflow.providers.standard.time.sensors.time import TimeSensor, TimeSensorAsync -from airflow.providers.standard.time.sensors.time_delta import TimeDeltaSensor, TimeDeltaSensorAsync -from airflow.providers.standard.time.sensors.weekday import DayOfWeekSensor +from airflow.providers.standard.sensors.time import TimeSensor, TimeSensorAsync +from airflow.providers.standard.sensors.time_delta import TimeDeltaSensor, TimeDeltaSensorAsync +from airflow.providers.standard.sensors.weekday import DayOfWeekSensor from airflow.sensors.bash import BashSensor from airflow.sensors.filesystem import FileSensor from airflow.sensors.python import PythonSensor diff --git a/airflow/example_dags/example_time_delta_sensor_async.py b/airflow/example_dags/example_time_delta_sensor_async.py index f8d43beb964f..15a1e52690a7 100644 --- a/airflow/example_dags/example_time_delta_sensor_async.py +++ b/airflow/example_dags/example_time_delta_sensor_async.py @@ -28,7 +28,7 @@ from airflow.models.dag import DAG from airflow.operators.empty import EmptyOperator -from airflow.providers.standard.time.sensors.time_delta import TimeDeltaSensorAsync +from airflow.providers.standard.sensors.time_delta import TimeDeltaSensorAsync with DAG( dag_id="example_time_delta_sensor_async", diff --git a/airflow/providers/standard/time/__init__.py b/airflow/providers/standard/operators/__init__.py similarity index 100% rename from airflow/providers/standard/time/__init__.py rename to airflow/providers/standard/operators/__init__.py diff --git a/airflow/providers/standard/time/operators/datetime.py b/airflow/providers/standard/operators/datetime.py similarity index 100% rename from airflow/providers/standard/time/operators/datetime.py rename to airflow/providers/standard/operators/datetime.py diff --git a/airflow/providers/standard/time/operators/weekday.py b/airflow/providers/standard/operators/weekday.py similarity index 100% rename from airflow/providers/standard/time/operators/weekday.py rename to airflow/providers/standard/operators/weekday.py diff --git a/airflow/providers/standard/provider.yaml b/airflow/providers/standard/provider.yaml index 3dc047d897e6..83d8acf0a68b 100644 --- a/airflow/providers/standard/provider.yaml +++ b/airflow/providers/standard/provider.yaml @@ -40,13 +40,13 @@ integrations: operators: - integration-name: Standard python-modules: - - airflow.providers.standard.time.operators.datetime - - airflow.providers.standard.time.operators.weekday + - airflow.providers.standard.operators.datetime + - airflow.providers.standard.operators.weekday sensors: - integration-name: Standard python-modules: - - airflow.providers.standard.time.sensors.date_time - - airflow.providers.standard.time.sensors.time_delta - - airflow.providers.standard.time.sensors.time - - airflow.providers.standard.time.sensors.weekday + - airflow.providers.standard.sensors.date_time + - airflow.providers.standard.sensors.time_delta + - airflow.providers.standard.sensors.time + - airflow.providers.standard.sensors.weekday diff --git a/airflow/providers/standard/time/operators/__init__.py b/airflow/providers/standard/sensors/__init__.py similarity index 100% rename from airflow/providers/standard/time/operators/__init__.py rename to airflow/providers/standard/sensors/__init__.py diff --git a/airflow/providers/standard/time/sensors/date_time.py b/airflow/providers/standard/sensors/date_time.py similarity index 100% rename from airflow/providers/standard/time/sensors/date_time.py rename to airflow/providers/standard/sensors/date_time.py diff --git a/airflow/providers/standard/time/sensors/time.py b/airflow/providers/standard/sensors/time.py similarity index 100% rename from airflow/providers/standard/time/sensors/time.py rename to airflow/providers/standard/sensors/time.py diff --git a/airflow/providers/standard/time/sensors/time_delta.py b/airflow/providers/standard/sensors/time_delta.py similarity index 100% rename from airflow/providers/standard/time/sensors/time_delta.py rename to airflow/providers/standard/sensors/time_delta.py diff --git a/airflow/providers/standard/time/sensors/weekday.py b/airflow/providers/standard/sensors/weekday.py similarity index 100% rename from airflow/providers/standard/time/sensors/weekday.py rename to airflow/providers/standard/sensors/weekday.py diff --git a/tests/dags/test_sensor.py b/tests/dags/test_sensor.py index b922ab2e5270..d023949e31a9 100644 --- a/tests/dags/test_sensor.py +++ b/tests/dags/test_sensor.py @@ -20,7 +20,7 @@ from airflow.decorators import task from airflow.models.dag import DAG -from airflow.providers.standard.time.sensors.date_time import DateTimeSensor +from airflow.providers.standard.sensors.date_time import DateTimeSensor from airflow.utils import timezone with DAG( diff --git a/airflow/providers/standard/time/sensors/__init__.py b/tests/providers/standard/operators/__init__.py similarity index 100% rename from airflow/providers/standard/time/sensors/__init__.py rename to tests/providers/standard/operators/__init__.py diff --git a/tests/providers/standard/time/operators/test_datetime.py b/tests/providers/standard/operators/test_datetime.py similarity index 99% rename from tests/providers/standard/time/operators/test_datetime.py rename to tests/providers/standard/operators/test_datetime.py index 9250ae147bf3..530450a963bd 100644 --- a/tests/providers/standard/time/operators/test_datetime.py +++ b/tests/providers/standard/operators/test_datetime.py @@ -26,7 +26,7 @@ from airflow.models.dagrun import DagRun from airflow.models.taskinstance import TaskInstance as TI from airflow.operators.empty import EmptyOperator -from airflow.providers.standard.time.operators.datetime import BranchDateTimeOperator +from airflow.providers.standard.operators.datetime import BranchDateTimeOperator from airflow.utils import timezone from airflow.utils.session import create_session from airflow.utils.state import State diff --git a/tests/providers/standard/time/operators/test_weekday.py b/tests/providers/standard/operators/test_weekday.py similarity index 99% rename from tests/providers/standard/time/operators/test_weekday.py rename to tests/providers/standard/operators/test_weekday.py index 338a6217cac6..7ad7415c366f 100644 --- a/tests/providers/standard/time/operators/test_weekday.py +++ b/tests/providers/standard/operators/test_weekday.py @@ -27,7 +27,7 @@ from airflow.models.taskinstance import TaskInstance as TI from airflow.models.xcom import XCom from airflow.operators.empty import EmptyOperator -from airflow.providers.standard.time.operators.weekday import BranchDayOfWeekOperator +from airflow.providers.standard.operators.weekday import BranchDayOfWeekOperator from airflow.utils import timezone from airflow.utils.session import create_session from airflow.utils.state import State diff --git a/tests/providers/standard/time/__init__.py b/tests/providers/standard/sensors/__init__.py similarity index 100% rename from tests/providers/standard/time/__init__.py rename to tests/providers/standard/sensors/__init__.py diff --git a/tests/providers/standard/time/sensors/test_date_time.py b/tests/providers/standard/sensors/test_date_time.py similarity index 95% rename from tests/providers/standard/time/sensors/test_date_time.py rename to tests/providers/standard/sensors/test_date_time.py index 10ffe42f631b..c51b5316206d 100644 --- a/tests/providers/standard/time/sensors/test_date_time.py +++ b/tests/providers/standard/sensors/test_date_time.py @@ -22,7 +22,7 @@ import pytest from airflow.models.dag import DAG -from airflow.providers.standard.time.sensors.date_time import DateTimeSensor +from airflow.providers.standard.sensors.date_time import DateTimeSensor from airflow.utils import timezone DEFAULT_DATE = timezone.datetime(2015, 1, 1) @@ -84,7 +84,7 @@ def test_invalid_input(self): ], ) @patch( - "airflow.providers.standard.time.sensors.date_time.timezone.utcnow", + "airflow.providers.standard.sensors.date_time.timezone.utcnow", return_value=timezone.datetime(2020, 1, 1, 23, 0, tzinfo=timezone.utc), ) def test_poke(self, mock_utcnow, task_id, target_time, expected): diff --git a/tests/providers/standard/time/sensors/test_time.py b/tests/providers/standard/sensors/test_time.py similarity index 97% rename from tests/providers/standard/time/sensors/test_time.py rename to tests/providers/standard/sensors/test_time.py index 6ef183ff6c7b..a144c3dc41de 100644 --- a/tests/providers/standard/time/sensors/test_time.py +++ b/tests/providers/standard/sensors/test_time.py @@ -25,7 +25,7 @@ from airflow.exceptions import TaskDeferred from airflow.models.dag import DAG -from airflow.providers.standard.time.sensors.time import TimeSensor, TimeSensorAsync +from airflow.providers.standard.sensors.time import TimeSensor, TimeSensorAsync from airflow.triggers.temporal import DateTimeTrigger from airflow.utils import timezone diff --git a/tests/providers/standard/time/sensors/test_time_delta.py b/tests/providers/standard/sensors/test_time_delta.py similarity index 96% rename from tests/providers/standard/time/sensors/test_time_delta.py rename to tests/providers/standard/sensors/test_time_delta.py index 4f2b202f1ad5..96368a42d48f 100644 --- a/tests/providers/standard/time/sensors/test_time_delta.py +++ b/tests/providers/standard/sensors/test_time_delta.py @@ -26,7 +26,7 @@ from airflow.models import DagBag from airflow.models.dag import DAG -from airflow.providers.standard.time.sensors.time_delta import ( +from airflow.providers.standard.sensors.time_delta import ( TimeDeltaSensor, TimeDeltaSensorAsync, WaitSensor, @@ -81,7 +81,7 @@ def test_timedelta_sensor(self, defer_mock, should_defer): [False, True], ) @mock.patch("airflow.models.baseoperator.BaseOperator.defer") - @mock.patch("airflow.providers.standard.time.sensors.time_delta.sleep") + @mock.patch("airflow.providers.standard.sensors.time_delta.sleep") def test_wait_sensor(self, sleep_mock, defer_mock, should_defer): wait_time = timedelta(seconds=30) op = WaitSensor( diff --git a/tests/providers/standard/time/sensors/test_weekday.py b/tests/providers/standard/sensors/test_weekday.py similarity index 98% rename from tests/providers/standard/time/sensors/test_weekday.py rename to tests/providers/standard/sensors/test_weekday.py index 900c3d869261..d4a0f04c2290 100644 --- a/tests/providers/standard/time/sensors/test_weekday.py +++ b/tests/providers/standard/sensors/test_weekday.py @@ -24,7 +24,7 @@ from airflow.exceptions import AirflowSensorTimeout from airflow.models import DagBag from airflow.models.dag import DAG -from airflow.providers.standard.time.sensors.weekday import DayOfWeekSensor +from airflow.providers.standard.sensors.weekday import DayOfWeekSensor from airflow.utils.timezone import datetime from airflow.utils.weekday import WeekDay from tests.test_utils import db diff --git a/tests/providers/standard/time/operators/__init__.py b/tests/providers/standard/time/operators/__init__.py deleted file mode 100644 index 13a83393a912..000000000000 --- a/tests/providers/standard/time/operators/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. diff --git a/tests/providers/standard/time/sensors/__init__.py b/tests/providers/standard/time/sensors/__init__.py deleted file mode 100644 index 13a83393a912..000000000000 --- a/tests/providers/standard/time/sensors/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. diff --git a/tests/sensors/test_external_task_sensor.py b/tests/sensors/test_external_task_sensor.py index f5e3843a11c3..3d6268834dce 100644 --- a/tests/sensors/test_external_task_sensor.py +++ b/tests/sensors/test_external_task_sensor.py @@ -38,7 +38,7 @@ from airflow.operators.bash import BashOperator from airflow.operators.empty import EmptyOperator from airflow.operators.python import PythonOperator -from airflow.providers.standard.time.sensors.time import TimeSensor +from airflow.providers.standard.sensors.time import TimeSensor from airflow.sensors.external_task import ( ExternalTaskMarker, ExternalTaskSensor,