jonathanshir commented on issue #8058:
URL: https://github.com/apache/airflow/issues/8058#issuecomment-619539473
My suggested changes:
The issue states we want to implement context similarly to flask.requests :
```
from airflow.task import context
@task
def context_task(...)
return context['run_date']
```
I think this is a bit of an over-complication - our use case is much simpler
than this.
We simply have a single execute context for each task instance, so my
intended implementation will be a bit simpler:
```
from airflow.current import current_context
@task
def context_task(...)
context = current_context()
return context['run_date']
```
The actual implementation will contain a simple stack data type that is
updated before op.execute is called.
Thoughts?
----------------------------------------------------------------
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]