ajitg25 commented on code in PR #44619:
URL: https://github.com/apache/airflow/pull/44619#discussion_r1871663336
##########
airflow/api_fastapi/core_api/routes/public/task_instances.py:
##########
@@ -671,6 +673,11 @@ def patch_task_instance(
fields_to_update = body.model_fields_set
if update_mask:
fields_to_update = fields_to_update.intersection(update_mask)
+ else:
+ try:
+ PatchTaskInstanceBody.model_validate(body)
+ except ValidationError as e:
+ raise RequestValidationError(errors=e.errors())
Review Comment:
exclude_none should not be used right?
You mentioned if the field in None then also we should update it.
In both
> cases I think we should only use set values. Things that the user
explicitely specified in the payload. (independently if those are None or not
None). You can take a look at patch_task_instance that leverages
model_fields_set to only retrive explicitely set values.
--
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]