-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Common mistakes docs section #8380
Comments
Hello, I would like to work on this issue! |
Great! Feel free to submit a PR and I'll review. A few common mistakes I can think of:
I'm sure there are many more that we could include - you could search on |
Hello, shall i make a single doc mentioning the title of the issue and then
linking the closed issue solution link for reference? If not, how do you
propose I solve this?
…On Sat, 16 Dec 2023 at 18:14, Sydney Runkle ***@***.***> wrote:
@SohamG934 <https://github.com/SohamG934>,
Great! Feel free to submit a PR and I'll review. A few common mistakes I
can think of:
- Mixing up how use_enum_values is used (we have an example in the API
docs)
- Mixing up how to add annotations to compound types (see #8362
<#8362>)
I'm sure there are many more that we could include - you could search on
duplicate tags to see what issues have been reported the most frequently!
—
Reply to this email directly, view it on GitHub
<#8380 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AX3DW7QYWWTQYI6HN76IIMLYJWJRHAVCNFSM6AAAAABAW4NJDOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJYHAYTAMBUGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi @SohamG934, I think we should create a new page for our documentation site that has various examples of common mistakes and ways to correct said mistakes. I don't see a reason to reference issues for the most part. You can create a fork of the pydantic repo and submit a PR with your changes 👍 |
Hi @sydney-runkle, is @SohamG934 still working on this issue? If not, I'd like to work on it. Thank you |
I haven't seen a PR yet, so feel free to get started on this :). Thanks! |
I've assigned you to this issue :) |
Thank you for assigning me this issue. Just a couple questions:
|
There's no template at the moment - I'd recommend combing through issues listed as duplicates to see what kind of issues come up often. |
I have started working on documenting the Please see screenshot below. Thanks :) Work done so far:
Please kindly review it and let me know if this structure is okay or not. Thanks again |
The structure looks great. Nice work so far! |
Here's another I think should be included: #8708 |
See #8759 (comment) as the reason for closing this issue. I think this collection is more helpful to have as an issue than as an official docs page, despite my initial motivations for filing this issue. A helpful collection of recommendations, thanks to @bL34cHig0: #8759 |
Below shows the relevant docs sections for explaining each of these questions:
https://docs.pydantic.dev/latest/errors/errors/#customize-error-messages
https://docs.pydantic.dev/latest/migration/#changes-to-pydanticgenericsgenericmodel
https://docs.pydantic.dev/latest/migration/#url-and-dsn-types-in-pydanticnetworks-no-longer-inherit-from-str
This one makes more sense to have reported + documented as an issue, which is explained well here: This error occurs if you are using Python
No longer an issue
Pydantic does not currently support exhaustive validation, so it stops after the first error on a given field and
https://docs.pydantic.dev/latest/api/pydantic_core/#pydantic_core.ValidationError provides info on helpful static methods
A simple solution to this is to allow your class to inherit from both https://docs.pydantic.dev/latest/api/standard_library_types/#enum |
Many of the issues we get are repeats of the same common questions / mistakes. We should create a small docs section logging said common mistakes and their solutions :).
The text was updated successfully, but these errors were encountered: