Lee-W commented on code in PR #54891:
URL: https://github.com/apache/airflow/pull/54891#discussion_r2303302557
##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/asset_events.py:
##########
@@ -75,6 +78,10 @@ def get_asset_event_by_asset_name_uri(
name: Annotated[str | None, Query(description="The name of the Asset")],
uri: Annotated[str | None, Query(description="The URI of the Asset")],
session: SessionDep,
+ after: Annotated[UtcDateTime | None, Query(description="The start of the
time range")] = None,
+ before: Annotated[UtcDateTime | None, Query(description="The end of the
time range")] = None,
Review Comment:
Do we want to fail `before < after` early?
##########
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:
If I'm not mistaken, we're to allow something like
```python
context['inlet_events'][(Asset("ABC"), {"order": "desc"})]
```
It's hard to read for me, not sure whether we could do something like
```python
context['inlet_events'][(Asset("ABC")].some_func({"order"=..., "limit"=...})
```
##########
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.
--
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]