-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Description
Description
We propose to add such features to airflow, which will allow the users to define a hook at the DAG level, and been executed before the pre_execution and after the post_execution.
TODO: we will propose detailed API change if such change is acceptable.
Use case / motivation
Airflow supports the operator to define their custom pre_execution/post_execution method, which will be exeucted before/after the execution of the operator, respectively.
But is hard to inject such hooks to existing operators, without modifying the code. i.e., airfow doesn't support a global pre-hook/post-hook to run before/after execution of every operators.
Such kind of hooks could be used for preparing the required inputs and finalizing the produced outputs for every operators in the DAG, etc. For example, the underlying XCom backends may support local values more efficiently than remote value accessing, the pre/post hook that the DAG level could do a migration/replication before the execution of operators, and gain end-to-end performance improvement.
Are you willing to submit a PR?
Yes, we would like to submit a PR if this feature request is acceptable.
Related Issues
None.