potiuk commented on issue #14396:
URL: https://github.com/apache/airflow/issues/14396#issuecomment-785354846
Also one more point - since we are in Python world - users could do whatever
they want in the Python code of their custom operators. Currently 'context' is
part of the public API of Airflow that users rely on being dictionary.
For example I can very easily imagine someone decides to add a new field to
context and pass it further.
```
@task
def my_task():
context = get_current_context()
ti = context["ti"]
context['my_key'] = 'my_value'
call_another_function(context)
```
While we do not encourage this behavior in any way, it is tempting to use
the context this way and as a user you could do that and you could rely on
context being dictionary able to hold any key you want. Dataclass breaks this
assumption.
----------------------------------------------------------------
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]