Skip to content

Commit 0035668

Browse files
atul-astronomerAtul Singh
andauthored
Deprecated import fix for TimeDeltaSensorAsync in example dags (apache#52285)
Co-authored-by: Atul Singh <[email protected]>
1 parent 593dc55 commit 0035668

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

airflow-core/src/airflow/example_dags/example_time_delta_sensor_async.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""
19-
Example DAG demonstrating ``TimeDeltaSensorAsync``, a drop in replacement for ``TimeDeltaSensor`` that
20-
defers and doesn't occupy a worker slot while it waits
19+
Example DAG demonstrating ``TimeDeltaSensor``, that defers and doesn't occupy a worker slot while it waits
2120
"""
2221

2322
from __future__ import annotations
@@ -27,7 +26,7 @@
2726
import pendulum
2827

2928
from airflow.providers.standard.operators.empty import EmptyOperator
30-
from airflow.providers.standard.sensors.time_delta import TimeDeltaSensorAsync
29+
from airflow.providers.standard.sensors.time_delta import TimeDeltaSensor
3130
from airflow.sdk import DAG
3231

3332
with DAG(
@@ -37,6 +36,6 @@
3736
catchup=False,
3837
tags=["example"],
3938
) as dag:
40-
wait = TimeDeltaSensorAsync(task_id="wait", delta=datetime.timedelta(seconds=30))
39+
wait = TimeDeltaSensor(task_id="wait", delta=datetime.timedelta(seconds=30), deferrable=True)
4140
finish = EmptyOperator(task_id="finish")
4241
wait >> finish

0 commit comments

Comments
 (0)