You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/05/05 11:44:04 UTC

[GitHub] [airflow] jonathanshir commented on pull request #8651: [AIP-31] [AIRFLOW-8058] Retrieve current execution context without altering function's signature

jonathanshir commented on pull request #8651:
URL: https://github.com/apache/airflow/pull/8651#issuecomment-624005459


   > I don't really understand it yet. Could you provide a practical example?
   
   So let's start with what exists today to give users more visibility and control into airflow's flow:
   The easiest way to interject into airflow's compile-time code: "Task Policy".
   In `airflow.settings.policy` you can see that the user can define his own policy to be called for every task object inside every executing DAG. This gives the user the option to alter task objects during compile time.
   Keeping this in mind, currently there is no real way to alter airflow variables during execution.
   Our use case in databand.ai is basically validating and running checks on every single task before it is executed, without changing every single airflow operator!
   It is important to mention that I think some confusion may have arose from the "bad name" in the configuration:
   This feature only allows you to define a contextmanager that is called before a task is executed. It **does not** alter airflow's context in any way, it only allows the user to do so. We have seen no clear use case for "replacing" airflow's context, so this is only an **addition**, hence will be renaming the feature to `additional_execute_contextmanager` instead of `user_defined_execute_context`


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org