-
Notifications
You must be signed in to change notification settings - Fork 21
fix(python): exclude unset API values on model dump #3777
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
Conversation
✔️ Code generated!
📊 Benchmark resultsBenchmarks performed on the method using a mock server, the results might not reflect the real-world performance.
|
3ad5b24
to
2a89472
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
@@ -2,5 +2,5 @@ argcomplete==3.5.0 | |||
click==8.1.7 | |||
packaging==24.1 | |||
pipx==1.7.1 | |||
platformdirs==4.3.3 | |||
platformdirs==4.2.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the downgrade ? I think this file should be excluded from PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idk I've let the tooling do its thing, it was after this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gg
…d) [skip ci] Co-authored-by: Clément Vannicatte <[email protected]>
algolia/api-clients-automation#3777 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
🧭 What and Why
🎟 JIRA Ticket: https://algolia.atlassian.net/browse/DI-2951
Changes included:
see https://algolia.slack.com/archives/C336MP4UA/p1726487274846109 for context
Pydantic requires default values on optional fields (which is an other problem I should tackle), but those default values are also added to the dict when dumping the model, which we don't want because we only want to rely on what the API returns, in case there's a change there before it is reflected on the client.
We now tell Pydantic to only rely on values that are set, and ignore the defaults.
You can try it by running the playground as-is, and see that the default searchParams are not provided, only the one explicit defined