phanikumv commented on code in PR #29260:
URL: https://github.com/apache/airflow/pull/29260#discussion_r1190578399
##########
airflow/sensors/external_task.py:
##########
@@ -414,6 +417,62 @@ def _handle_execution_date_fn(self, context) -> Any:
return kwargs_callable(logical_date, **kwargs)
+class ExternalTaskAsyncSensor(ExternalTaskSensor):
+ """
+ Waits for a different DAG, task group, or task to complete for a specific
logical date asynchronously.
+
+ :param external_dag_id: The dag_id that contains the task you want to
+ wait for
+ :param external_task_id: The task_id that contains the task you want to
+ wait for
+ :param allowed_states: Iterable of allowed states, default is
``['success']``
+ :param execution_delta: time difference with the previous execution to
+ look at, the default is the same logical date as the current task or
DAG.
+ For yesterday, use [positive!] datetime.timedelta(days=1). Either
+ execution_delta or execution_date_fn can be passed to
+ ExternalTaskSensor, but not both.
+ :param poll_interval: Time (seconds) to wait between calls to check the
run status.
+ """
+
+ def __init__(
+ self,
+ *,
+ external_task_id: str | None = None,
+ poll_interval: float = 2.0,
Review Comment:
we should have a `deferrable` param to `ExternalTaskSensor` and add the new
functionality instead of adding a new sensor altogether.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]