Skip to content

Commit

Permalink
remove time folder from standard provider
Browse files Browse the repository at this point in the history
  • Loading branch information
gopidesupavan committed Sep 21, 2024
1 parent 6a527c9 commit 646bb8d
Show file tree
Hide file tree
Showing 25 changed files with 22 additions and 54 deletions.
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
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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

0 comments on commit 646bb8d

Please sign in to comment.