amoghrajesh commented on code in PR #43881:
URL: https://github.com/apache/airflow/pull/43881#discussion_r1840121304
##########
tests/api_fastapi/core_api/routes/public/test_assets.py:
##########
@@ -229,3 +303,94 @@ def test_should_respect_page_size_limit_default(self,
test_client):
assert response.status_code == 200
assert len(response.json()["assets"]) == 100
+
+
+class TestGetAssetsEvents(TestAssets):
Review Comment:
Ok great makes sense.
##########
airflow/api_fastapi/core_api/routes/public/assets.py:
##########
@@ -69,3 +79,46 @@ def get_assets(
assets=[AssetResponse.model_validate(asset, from_attributes=True) for
asset in assets],
total_entries=total_entries,
)
+
+
+@assets_router.get(
+ "/events",
+ responses=create_openapi_http_exception_doc([401, 403, 404]),
+)
+async def get_asset_events(
+ limit: QueryLimit,
+ offset: QueryOffset,
+ order_by: Annotated[
+ SortParam,
+ Depends(
+ SortParam(
+ ["timestamp", "source_dag_id", "source_task_id",
"source_run_id", "source_map_index"],
+ AssetEvent,
+ ).dynamic_depends("timestamp")
Review Comment:
Is that how the legacy behaves? If that's the behaviour of legacy, lets keep
it that way
##########
tests/api_fastapi/core_api/routes/public/test_assets.py:
##########
@@ -229,3 +303,94 @@ def test_should_respect_page_size_limit_default(self,
test_client):
assert response.status_code == 200
assert len(response.json()["assets"]) == 100
+
+
+class TestGetAssetEvents(TestAssets):
Review Comment:
Let us cover the cases for:
`test_order_by_raises_400_for_invalid_attr`
--
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]