uranusjr commented on code in PR #54891:
URL: https://github.com/apache/airflow/pull/54891#discussion_r2303455175
##########
task-sdk/src/airflow/sdk/execution_time/context.py:
##########
@@ -537,7 +538,10 @@ def __iter__(self) -> Iterator[Asset | AssetAlias]:
def __len__(self) -> int:
return len(self._inlets)
- def __getitem__(self, key: int | Asset | AssetAlias | AssetRef) ->
list[AssetEventResult]:
+ def __getitem__(
+ self,
+ key: int | Asset | AssetAlias | AssetRef | tuple[int | Asset |
AssetAlias | AssetRef, dict[str, Any]],
Review Comment:
_Technically_ we could do some magic to make the return value not a list but
a subclass of collection.abc.Sequence (or MutableSequence if we want to suppor
that), and implement further filtering there. It’s technically breaking, but I
feel that’s minor enough I would let it pass.
We actually never promised the return value would be a list. I wrote the
documentation intentionally to just say “sequence-like” instead.
https://airflow.apache.org/docs/apache-airflow/stable/authoring-and-scheduling/assets.html#fetching-information-from-previously-emitted-asset-events
--
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]