You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "scr-oath (via GitHub)" <gi...@apache.org> on 2023/08/04 16:38:36 UTC
[GitHub] [airflow] scr-oath commented on issue #30229: Update Python operator how-to with @task.sensor example
scr-oath commented on issue #30229:
URL: https://github.com/apache/airflow/issues/30229#issuecomment-1665895969
FWIW, I tried this simple sensor code - this use case is similar to how oozie workflows/coordinators can wait for data to exist for their schdeule…
I was surprised to see that context is not injected into `@task.sensor` is this by design or a separate issue that should be filed?
```python
@dag(
schedule='@daily',
start_date=pendulum.datetime(2023, 1, 1, tz="UTC"),
tags=['triggering', 'datasets']
)
def ds_consumer():
@task.sensor(poke_interval=60, timeout=86400, mode='reschedule')
def wait_for_upstream(ds=None) -> PokeReturnValue:
assert ds is not None
# ... Hits the assertion ^
```
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org