uranusjr commented on code in PR #42189:
URL: https://github.com/apache/airflow/pull/42189#discussion_r1757284886


##########
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:
   We should be more efficient than this. A dict or set would be better.



-- 
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]

Reply via email to