uranusjr commented on issue #15286:
URL: https://github.com/apache/airflow/issues/15286#issuecomment-850344974
That’s an interesting idea, but would require much more change since we
don’t currently have a hook point for DAG to do pre-processing before operators
are run.
Maybe something like this would be easier:
```python
with DAG(...) as dag:
t0 = CreateVirtualEnvironmentOperator(task_id="init_venv", ...)
python_prefix_template = "{{
ti.xcom_pull(task_ids='init_venv')['prefix'] }}"
t1 = ExternalPythonOperator(..., python_prefix=python_prefix_template)
t2 = ExternalPythonOperator(..., python_prefix=python_prefix_template)
t0 >> t1 >> t2
```
There are probably abstractions available to make this easier, but that’s
the basic idea.
--
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:
[email protected]