Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deployments SDK to use the PATCH /deployments endpoint when updating deployments #15529

Open
desertaxle opened this issue Sep 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@desertaxle
Copy link
Member

Bug summary

When users invoke either prefect deploy or flow.deploy() to update an existing deployment, the SDK will use the POST /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)

Version:             3.0.3
API version:         0.8.4
Python version:      3.12.5
Git commit:          d9c51bc3
Built:               Fri, Sep 20, 2024 8:52 AM
OS/Arch:             darwin/arm64
Profile:             local
Server type:         server
Pydantic version:    2.9.2

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.

@desertaxle desertaxle added the bug Something isn't working label Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant