Anuragp22 commented on code in PR #67725:
URL: https://github.com/apache/airflow/pull/67725#discussion_r3479033997


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/ui/partitioned_dag_runs.py:
##########
@@ -463,15 +465,21 @@ def get_pending_partitioned_dag_run(
     total_required = sum(a.required_count for a in assets)
     asset_expression = dag_model.asset_expression if dag_model is not None 
else None
 
-    return PartitionedDagRunDetailResponse(
-        id=partitioned_dag_run.id,
-        dag_id=dag_id,
-        partition_key=partition_key,
-        created_at=partitioned_dag_run.created_at.isoformat() if 
partitioned_dag_run.created_at else None,
-        updated_at=partitioned_dag_run.updated_at.isoformat() if 
partitioned_dag_run.updated_at else None,
-        created_dag_run_id=partitioned_dag_run.created_dag_run_id,
-        assets=assets,
-        total_required=total_required,
-        total_received=total_received,
-        asset_expression=asset_expression,
+    return PartitionedDagRunDetailResponse.model_validate(
+        {
+            "id": partitioned_dag_run.id,
+            "dag_id": dag_id,
+            "partition_key": partition_key,
+            "created_at": partitioned_dag_run.created_at.isoformat()
+            if partitioned_dag_run.created_at
+            else None,
+            "updated_at": partitioned_dag_run.updated_at.isoformat()
+            if partitioned_dag_run.updated_at
+            else None,
+            "created_dag_run_id": partitioned_dag_run.created_dag_run_id,
+            "assets": assets,
+            "total_required": total_required,
+            "total_received": total_received,
+            "asset_expression": asset_expression,
+        }
     )

Review Comment:
   Done. Pulled the dict into a `model_data` local for all five 
`model_validate` call sites in the partitioned and next-run-assets routes, not 
just this one, for consistency. 4dd3696584
   



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