Lee-W commented on code in PR #42189:
URL: https://github.com/apache/airflow/pull/42189#discussion_r1757524804
##########
airflow/utils/context.py:
##########
@@ -190,12 +190,11 @@ def add(self, dataset: Dataset | str, extra: dict[str,
Any] | None = None) -> No
else:
return
- if extra:
- self.extra = extra
-
- self.dataset_alias_event = DatasetAliasEvent(
- source_alias_name=dataset_alias_name, dest_dataset_uri=dataset_uri
+ event = DatasetAliasEvent(
+ source_alias_name=dataset_alias_name,
dest_dataset_uri=dataset_uri, extra=extra or {}
)
+ if event not in self.dataset_alias_events:
+ self.dataset_alias_events.append(event)
Review Comment:
Yep, I thought of it. But that might mean we need to make
`dataset_alias_events` (`list[dict[str | dict[str, Any]]]`)hashable, which I
guess (?) we don't really want to. Another thing I'm thinking of is just adding
it anyway and process them in
[taskinstance](https://github.com/apache/airflow/blob/3bc2d3aef6c348e26775f4711ac593acfac9595e/airflow/models/taskinstance.py#L2896)
all at once.
--
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]