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
Pydantic fail to parse ClassVar annotation when it's a string #3401
Labels
bug V1
Bug related to Pydantic V1.X
Comments
For some additional context, this happens with Python 3.9.8 |
rra
added a commit
to lsst/daf_butler
that referenced
this issue
Nov 11, 2021
As of Python 3.9.8, this does not work with Pydantic BaseModel, and does not work in a way that causes the whole module to fail to import. See pydantic/pydantic#3401. In general, Pydantic does not work well with string types as enabled by from __future__ import annotations.
rra
added a commit
to lsst/daf_butler
that referenced
this issue
Nov 11, 2021
As of Python 3.9.8, this does not work with Pydantic BaseModel, and does not work in a way that causes the whole module to fail to import. See pydantic/pydantic#3401. In general, Pydantic does not work well with string types as enabled by from __future__ import annotations, which is why making that feature the default has been delayed. See https://lwn.net/Articles/858576/ for more information.
rra
added a commit
to lsst/daf_butler
that referenced
this issue
Nov 11, 2021
As of Python 3.9.8, this does not work with Pydantic BaseModel, and does not work in a way that causes the whole module to fail to import. See pydantic/pydantic#3401. In general, Pydantic does not work well with string types as enabled by from __future__ import annotations, which is why making that feature the default has been delayed. See https://lwn.net/Articles/858576/ for more information. Fix this by removing from __future__ import annotations from the files using ClassVar and explicitly quote the type arguments that contain forward references (all of which are outside the scope of what Pydantic cares about).
2 tasks
Also running into this. |
Also running into this. It's quite severe as base Docker images automatically updated to Python 3.9.8 and there's no easy way to go back and we basically can't build any new releases. |
JacobHayes
added a commit
to artigraph/artigraph
that referenced
this issue
Nov 16, 2021
…y hints to standardize and bypass pydantic/pydantic#3401
JacobHayes
added a commit
to artigraph/artigraph
that referenced
this issue
Nov 16, 2021
…y hints to standardize and bypass pydantic/pydantic#3401
JacobHayes
added a commit
to artigraph/artigraph
that referenced
this issue
Nov 16, 2021
…y hints to standardize and bypass pydantic/pydantic#3401
JacobHayes
added a commit
to artigraph/artigraph
that referenced
this issue
Nov 17, 2021
…y hints to standardize and bypass pydantic/pydantic#3401
andyshinn
added a commit
to andyshinn/wbld
that referenced
this issue
Apr 2, 2022
andyshinn
added a commit
to andyshinn/wbld
that referenced
this issue
Apr 2, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Checks
Bug
Output of
python -c "import pydantic.utils; print(pydantic.utils.version_info())"
:The text was updated successfully, but these errors were encountered: