uranusjr commented on code in PR #38432:
URL: https://github.com/apache/airflow/pull/38432#discussion_r1537218134
##########
airflow/models/taskinstance.py:
##########
@@ -2553,21 +2554,30 @@ def _run_raw_task(
return None
- def _register_dataset_changes(self, *, session: Session) -> None:
+ def _register_dataset_changes(self, result: Any, *, session: Session) ->
None:
if TYPE_CHECKING:
assert self.task
for obj in self.task.outlets or []:
self.log.debug("outlet obj %s", obj)
# Lineage can have other types of objects besides datasets
if isinstance(obj, Dataset):
+ if obj.extra:
+ extra = obj.extra
+ elif obj.extra_from_return:
+ extra = result if isinstance(result, dict) else
{str(self.task_id): result}
Review Comment:
Automatically putting the value under a key is too magical to me. I would
prefer this either just forward the value (the extra field is capable of
storing any JSON-able values, after all), or skip the value entirely if it has
an unexpected type. The task ID is also not a particularly obvious key either.
--
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]