Skip to content
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

[BUG]: Upgrade pydantic dep to ^2.7.4 to allow compatibility with Python 2.12 #38

Open
egeres opened this issue Aug 13, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@egeres
Copy link

egeres commented Aug 13, 2024

Python -VV

Python 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:12:24) [GCC 11.2.0]

Pip Freeze

aiohttp==3.9.5
aiosignal==1.3.1
annotated-types==0.7.0
anyio==4.4.0
attrs==23.2.0
certifi==2024.7.4
charset-normalizer==3.3.2
cowsay==6.1
distro==1.9.0
frozenlist==1.4.1
greenlet==3.0.3
h11==0.14.0
httpcore==1.0.5
httpx==0.27.0
idna==3.7
iniconfig==2.0.0
jsonpatch==1.33
jsonpointer==3.0.0
jsonschema==4.21.1
jsonschema-specifications==2023.12.1
langchain==0.2.5
langchain-core==0.2.8
langchain-openai==0.1.14
langchain-text-splitters==0.2.1
langsmith==0.1.81
loguru==0.7.2
markdown-it-py==3.0.0
mdurl==0.1.2
mistral_common==1.3.3
multidict==6.0.5
numpy==1.26.4
openai==1.37.1
orjson==3.10.6
packaging==24.1
pluggy==1.5.0
pydantic==2.6.1
pydantic_core==2.16.2
Pygments==2.18.0
pytest==8.3.2
PyYAML==6.0.1
referencing==0.35.1
regex==2024.7.24
requests==2.32.3
rich==13.7.1
rpds-py==0.20.0
ruff==0.5.5
sentencepiece==0.2.0
setuptools==69.5.1
sniffio==1.3.1
SQLAlchemy==2.0.31
tenacity==8.5.0
tiktoken==0.7.0
tqdm==4.66.4
typing_extensions==4.12.2
urllib3==2.2.2
wheel==0.43.0
yarl==1.9.4

Reproduction Steps

Run:

from langchain_core.output_parsers.base import BaseOutputParser

Expected Behavior

That single import should work, but it instead raises the following error:

TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'

Additional Context

No response

Suggested Solutions

This isn't a problem of mistral-common per se, it rather comes from the pydantic version 2.6.1, the error has been addressed on pydantic/pydantic#9637 and it's been fixed in version 2.7.4

Related to this other issue: #15, the version specified on the https://github.com/mistralai/mistral-common/blob/main/pyproject.toml should probably be prefixed with a caret such that:

...
python = "^3.8.10"
- pydantic = "2.6.1"
+ pydantic = "^2.7.4"
jsonschema = "4.21.1"
...

This would allow the project being compatible with every pydantic version above 2.7.4 but constrained to that major version number (a version 3 is underway, they will probably change many things of the API, but I haven't checked the specifics yet)

@egeres egeres added the bug Something isn't working label Aug 13, 2024
@egeres
Copy link
Author

egeres commented Aug 13, 2024

Considering this other issue: #37 it might even be a good idea to directly have the version set as ^2.8.2

egeres added a commit to egeres/mistral-common that referenced this issue Aug 13, 2024
@patrickvonplaten
Copy link
Contributor

Thanks a lot for the issue! Think we can leave at ^2.6.1 because mistralai and mistral_common are different packages and ^2.6.1 will always install the lastest version which should be compatible with mistralai

@patrickvonplaten
Copy link
Contributor

#40

@patrickvonplaten
Copy link
Contributor

#40 is merged and 1.3.4 is out - let me know if this solves the issue :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants