malthe opened a new pull request #17576:
URL: https://github.com/apache/airflow/pull/17576
This adds optional operator parameters `pre_execute` and `post_execute`,
both of which run synchronously immediately before and after task execution.
For example, this can be used to skip execution for a particular day of the
week:
```python
from croniter import match
def execute_unless(cron_expr):
def hook(context):
if match(cron_expr, context["execution_date"]):
raise AirflowSkipException()
return hook
DummyOperator(..., pre_execute=execute_unless("* * * * sat"))
```
Related: #17545
--
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]