GitHub user darkag created a discussion: Is on_execute_callback can be used to 
initialize operators parameters at execution ?

Hello,

I wonder if I might have a problem with this type of use of 
on_execute_callback, as far as I've tested I suppose that's ok but I may miss 
something important : 

```python
def on_exec_callback_bash(context):
        from airflow.hooks.base import BaseHook
        vc = BaseHook.get_connection("my_connection")
        context['ti'].task.env = { "varenv": vc.host }
    
bash = BashOperator(task_id="also_run_this", bash_command='echo $varenv', 
on_execute_callback = on_exec_callback_bash)
```



GitHub link: https://github.com/apache/airflow/discussions/58493

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to