vatsrahul1001 commented on code in PR #43881:
URL: https://github.com/apache/airflow/pull/43881#discussion_r1840802410


##########
airflow/api_fastapi/core_api/datamodels/assets.py:
##########
@@ -64,3 +64,45 @@ class AssetCollectionResponse(BaseModel):
 
     assets: list[AssetResponse]
     total_entries: int
+
+
+class DagRunAssetReference(BaseModel):
+    """Serializable version of the DagRunAssetReference ORM SqlAlchemyModel."""
+
+    run_id: str
+    dag_id: str
+    execution_date: datetime = Field(alias="logical_date")
+    start_date: datetime
+    end_date: datetime
+    state: str
+    data_interval_start: datetime
+    data_interval_end: datetime
+
+
+class AssetEventResponse(BaseModel):
+    """Asset event serializer for responses."""
+
+    id: int
+    asset_id: int
+    asset_uri: str
+    extra: dict | None = None
+    source_task_id: str | None = None
+    source_dag_id: str | None = None
+    source_run_id: str | None = None
+    source_map_index: int
+    created_dagruns: list[DagRunAssetReference]
+    timestamp: datetime
+
+    @model_validator(mode="before")
+    def rename_uri_to_asset_uri(cls, values):
+        """Rename 'uri' to 'asset_uri' during serialization to match legacy 
response."""
+        if hasattr(values, "uri") and values.uri:
+            values.asset_uri = values.uri
+        return values

Review Comment:
   Done



##########
airflow/api_fastapi/core_api/routes/public/assets.py:
##########
@@ -69,3 +79,52 @@ 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(

Review Comment:
   Done



-- 
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]

Reply via email to