potiuk commented on a change in pull request #20425:
URL: https://github.com/apache/airflow/pull/20425#discussion_r772488115
##########
File path: airflow/operators/python.py
##########
@@ -173,7 +173,9 @@ def __init__(
self.show_return_value_in_logs = show_return_value_in_logs
def execute(self, context: Context) -> Any:
- context.update(self.op_kwargs)
+ # The casting below is not `perfect`, but we "pretend" that context is
TypedDict via Context.pyi
+ # So no harm done and it will work as expected.
+ context.update(cast(Context, self.op_kwargs))
context['templates_dict'] = self.templates_dict
Review comment:
Ah yeah. I like it more :)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]