Lee-W commented on code in PR #40478:
URL: https://github.com/apache/airflow/pull/40478#discussion_r1669867748
##########
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:
but `DatasetAlias.name` is not uri at all. not sure whether it makes sense
--
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]