Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing time folder from standard provider operators/sensors #42392

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airflow/example_dags/example_branch_datetime_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions airflow/example_dags/example_sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion airflow/example_dags/example_time_delta_sensor_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions airflow/providers/standard/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion tests/dags/test_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 0 additions & 16 deletions tests/providers/standard/time/operators/__init__.py

This file was deleted.

16 changes: 0 additions & 16 deletions tests/providers/standard/time/sensors/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/sensors/test_external_task_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down