gGonz commented on issue #34158:
URL: https://github.com/apache/airflow/issues/34158#issuecomment-2167066979

   > @gGonz
   > 
   > > Can we at least have some workaround or example, the docs on the links 
pointed above doesn't provide any hint of how to fix this issue.
   > 
   > Even though it is not possible to access the full `**context` or `ti` you 
can access most variables directly: 
https://airflow.apache.org/docs/apache-airflow/stable/templates-ref.html
   > 
   > example:
   > 
   > ```python
   > @task.virtualenv(
   >     requirements=[
   >         "colormap==1.1.0"
   >     ]
   > )
   > def test(params=None, data_interval_end=None, run_id=None, 
logical_date=None):
   >     print(params)
   >     print(data_interval_end)
   >     print(run_id)
   >     print(logical_date)
   > ```
   > 
   > if you need to pass aditional static data to the task you also use 
`default_args` of the dag, f.e. you can pass the `dag_id` using this.
   
   Thanks, in my case I also needed to add `use_dill=True` to the 
`@task.virtualenv()` decorator to make it work.


-- 
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: commits-unsubscr...@airflow.apache.org

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

Reply via email to