Update deployments SDK to use the PATCH /deployments
endpoint when updating deployments
#15529
Labels
bug
Something isn't working
Bug summary
When users invoke either
prefect deploy
orflow.deploy()
to update an existing deployment, the SDK will use thePOST /deployments
endpoint to upsert the deployment. All fields are set to the provided values, and the default value for unspecified fields. This results in deployment fields being reset even when they aren't specified in the SDK. This is especially problematic when new fields are added to the deployment schema since older clients will not provide the value and reset the value each time.We should update the deployments SDK to use the
PATCH /deployments
endpoint for existing deployments to better follow REST conventions and avoid overwriting fields with defaults when unspecified.Version info (
prefect version
output)Additional context
To mitigate this behavior for older clients, an update was made to the
POST /deployments
endpoint in #15491 to an update instead of an upsert on existing deployments.The text was updated successfully, but these errors were encountered: