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
Failed to import: Field
default cannot be set in Annotated
for 'num_Annotated[str, FieldInfo(min_length=1, extra={})]'
#169
Comments
For me, tests are passing, so there must be something unique to your environment that's incompatible. Perhaps you have an older, incompatible version of pydantic, which was introduced in version 6. |
Had the same issue. I installed the latest version of |
What I don't understand is why don't I encounter the error and why doesn't the error occur in the CI tests?
It's difficult for me to fix if I can't replicate the error. It's obviously not strictly a pydantic issue. There's another factor. Oh. That's interesting - pinning to pydantic 1.9, I can replicate the error:
I also can get tests in CI to fail with pydantic 1.9. Maybe the solution is simply to apply a minimum bound on pydantic to 1.10. |
In fact, tests pass on pydantic 1.9.1. |
Thanks, I think the issue is mostly clarified. Either need to update |
Looks like a pydantic bug introduced in 1.9. Fixed in 1.9.1.
I guess things are clear. Thanks for the tests! Feel free to close this issue. |
I confirmed that commit makes the difference:
Thanks everyone for the patience and understanding. |
Error message:
I'm using the library from conda-forge. Downgrading from
6.0.0-pyhd8ed1ab_0
to5.6.2-pyhd8ed1ab_0
fixes the issue.The text was updated successfully, but these errors were encountered: