apache / airflow

Apache Airflow - A platform to programmatically author, schedule, and monitor workflows
https://airflow.apache.org/
Apache License 2.0
37.39k stars 14.35k forks source link

AIP-84 Standardize PATCH Behavior Across Endpoints in FastAPI #43650

Open bugraoz93 opened 3 weeks ago

bugraoz93 commented 3 weeks ago

Description

None Values

Currently, the handling of None values in PATCH requests is inconsistent across different parts of the codebase. In some instances, when no mask is provided, None values are filtered out, while in others, such as the Pool model, all values (including None) are validated and persisted if the payload is valid. The objective of this work item is to standardize PATCH request behaviour regarding None values:

  1. When a mask is provided, use the values as specified by the mask.
  2. When no mask is provided, ensure the payload is validated independently as a fully-formed database entity, allowing for explicit setting of fields to None.

Database Calls

Avoid making database calls solely to check for existence; instead, delegate this responsibility to the database itself during the primary operation.

Use case/motivation

A standardized approach for PATCH endpoints is needed.

Related issues

Relates to: #42370 Follow Up of: #43102

Are you willing to submit a PR?

Code of Conduct

bugraoz93 commented 3 weeks ago

@pierrejeambrun created this as a follow-up for PATCH endpoints. FYI

pierrejeambrun commented 3 weeks ago

Thanks a lot, great description.

pierrejeambrun commented 6 hours ago

Up for grab, #good first issue!