amoghrajesh commented on code in PR #43825:
URL: https://github.com/apache/airflow/pull/43825#discussion_r1840337141
##########
airflow/api_fastapi/core_api/routes/public/assets.py:
##########
@@ -69,3 +69,20 @@ def get_assets(
assets=[AssetResponse.model_validate(asset, from_attributes=True) for
asset in assets],
total_entries=total_entries,
)
+
+
+@assets_router.get(
+ "/{uri:path}",
+ responses=create_openapi_http_exception_doc([401, 403, 404]),
+)
+async def get_asset(
+ uri: str,
+ session: Annotated[Session, Depends(get_session)],
+) -> AssetResponse:
+ """Get an asset."""
+ asset = session.scalar(select(AssetModel).where(AssetModel.uri == uri))
Review Comment:
Sure, looks like I missed it. Added and ran unit tests, it works as expected.
##########
airflow/api_fastapi/core_api/routes/public/assets.py:
##########
@@ -69,3 +69,20 @@ def get_assets(
assets=[AssetResponse.model_validate(asset, from_attributes=True) for
asset in assets],
total_entries=total_entries,
)
+
+
+@assets_router.get(
+ "/{uri:path}",
+ responses=create_openapi_http_exception_doc([401, 403, 404]),
+)
+async def get_asset(
Review Comment:
Right, made the change
--
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]