uranusjr commented on code in PR #38650:
URL: https://github.com/apache/airflow/pull/38650#discussion_r1548815506
##########
airflow/operators/python.py:
##########
@@ -232,7 +232,11 @@ def execute(self, context: Context) -> Any:
context_merge(context, self.op_kwargs,
templates_dict=self.templates_dict)
self.op_kwargs = self.determine_kwargs(context)
- return_value = self.execute_callable()
+ try:
+ dataset_events = context["dataset_events"]
+ except KeyError:
+ dataset_events = context["dataset_events"] =
DatasetEventAccessors()
+ return_value = self.execute_callable(dataset_events)
Review Comment:
Because `execute_callable` does not receive the context at all. If you ask
me it’s sort of designed quite weirdly to begin with.
I think I have a way to avoid not passing in the additional argument, by
storing the value on the operator (`self`) instead. It’s a bit hacky and more
of a workaround.
--
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]