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


##########
airflow/utils/context.py:
##########
@@ -178,16 +216,22 @@ class OutletEventAccessors(Mapping[str, 
OutletEventAccessor]):
     def __init__(self) -> None:
         self._dict: dict[str, OutletEventAccessor] = {}
 
+    def __str__(self) -> str:
+        return f"OutletEventAccessors(_dict={self._dict})"
+
     def __iter__(self) -> Iterator[str]:
         return iter(self._dict)
 
     def __len__(self) -> int:
         return len(self._dict)
 
-    def __getitem__(self, key: str | Dataset) -> OutletEventAccessor:
-        if (uri := coerce_to_uri(key)) not in self._dict:
-            self._dict[uri] = OutletEventAccessor({})
-        return self._dict[uri]
+    def __getitem__(self, key: str | Dataset | DatasetAlias) -> 
OutletEventAccessor:
+        dict_key = key.name if isinstance(key, DatasetAlias) else 
coerce_to_uri(key)

Review Comment:
   True, but we don’t really care the output value is a URI here, just a key. 
Or other places this is used either. We can always rename the function.



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