imrichardwu commented on code in PR #62583:
URL: https://github.com/apache/airflow/pull/62583#discussion_r3023676323


##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/deadline.py:
##########
@@ -44,3 +44,58 @@ class DeadlineCollectionResponse(BaseModel):
 
     deadlines: Iterable[DeadlineResponse]
     total_entries: int
+
+
+class DeadlineWithDagRunResponse(BaseModel):
+    """Deadline serializer for responses that includes DAG and DAG run 
identifiers."""
+
+    id: UUID
+    deadline_time: datetime
+    missed: bool
+    created_at: datetime
+    dag_id: str = Field(validation_alias=AliasPath("dagrun", "dag_id"))
+    dag_run_id: str = Field(validation_alias=AliasPath("dagrun", "run_id"))
+    alert_name: str | None = 
Field(validation_alias=AliasPath("deadline_alert", "name"), default=None)
+    alert_description: str | None = Field(
+        validation_alias=AliasPath("deadline_alert", "description"), 
default=None
+    )

Review Comment:
   I created another serializer because I saw grantt.py and grid.py did not 
have the wildcard, so I created another one that will handle wildcards. But 
yeah, we should be able to add the necessary stuff to DeadlineResponse and use 
it.



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