hussein-awala commented on code in PR #54891:
URL: https://github.com/apache/airflow/pull/54891#discussion_r2303397771
##########
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:
> Should we make int | Asset | AssetAlias | AssetRef a TypeAlias? It's not
easy to read this way.
yes that was my first thought, i will update it tonight
> It's hard to read for me, not sure whether we could do something like
context['inlet_events'][(Asset("ABC")].some_func({"order"=..., "limit"=...})
I completely agree, but this is the only solution I found to avoid breaking
changes in the current access way --`[(Asset("ABC")]` should return the result,
and the filtering should be done before fetching and result, any change in the
returned type (`list[AssetEventResult]`) would be considered as a breaking
change for the users.
--
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]