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


##########
airflow/utils/context.py:
##########
@@ -245,28 +250,47 @@ class InletEventsAccessors(Mapping[str, 
LazyDatasetEventSelectSequence]):
 
     _inlets: list[Any]
     _datasets: dict[str, Dataset]
+    _dataset_aliases: dict[str, DatasetAlias]
     _session: Session
 
     def __init__(self, inlets: list, *, session: Session) -> None:
         self._inlets = inlets
-        self._datasets = {inlet.uri: inlet for inlet in inlets if 
isinstance(inlet, Dataset)}
         self._session = session
+        self._datasets = {}
+        self._dataset_aliases = {}
+
+        for inlet in inlets:
+            if isinstance(inlet, Dataset):
+                self._datasets[inlet.uri] = inlet
+            elif isinstance(inlet, DatasetAlias):
+                self._dataset_aliases[inlet.name] = inlet

Review Comment:
   This makes me wonder if we should have something in BaseDataset to 
encapsulate getting a key out of the classes. That’s refactoring for another 
day, I guess.



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