ajitg25 commented on code in PR #44619:
URL: https://github.com/apache/airflow/pull/44619#discussion_r1871695530
##########
airflow/api_fastapi/core_api/routes/public/dag_run.py:
##########
@@ -140,9 +142,16 @@ def patch_dag_run(
if not dag:
raise HTTPException(status.HTTP_404_NOT_FOUND, f"Dag with id {dag_id}
was not found")
+ fields_to_update = patch_body.model_fields_set
+
if update_mask:
- data = patch_body.model_dump(include=set(update_mask))
+ fields_to_update = fields_to_update.intersection(update_mask)
+ data = patch_body.model_dump(include=fields_to_update)
else:
+ try:
+ DAGRunPatchBody(**patch_body.model_dump())
+ except ValidationError as e:
+ raise RequestValidationError(errors=e.errors())
data = patch_body.model_dump()
Review Comment:
will make it consistent with `data =
body.model_dump(include=fields_to_update, by_alias=True)` as we should also
update fields with None I am not using `exclude_none=True`
--
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]