-
Notifications
You must be signed in to change notification settings - Fork 223
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
The misuse of smart union in pydantic #72
Comments
This to be honest is an upstream issue, i don't think we can solve it? |
One possible quick solution is to disable the smart union in the pydantic model definition
https://github.com/jina-ai/docarray/blob/main/docarray/document/pydantic_model.py#L30-L50 But I'm not very clear whether this change will not destroy other API/functions. |
With this PR #73, we can get the following result
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The string value
"1"
indoc.tags
will be automatically converted to boolTrue
when using.to_pydantic_model
. This would not make sense.The reproduce script:
yields the following output:
The text was updated successfully, but these errors were encountered: