-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Install issue]: type object 'CreateCollection' has no attribute 'model_validate' during Create Index #2137
Comments
This is a good point - @tazarov should we bump the version? |
Pydantic 1.x also has similar function to so maybe we can implement an adapter that is version-aware function to keep backward compatibility. We've added the orjson serialization in 0.5.0 and so far @zhou9110 is the first to notice which leads me to believe that not so many people are running pydantic <2.x. Maybe bumping the pydantic range >=2.0 and ditching 1.x as part of the 0.5.x versions can be an OK approach. However if we go 2.x route we may want to also add pydantic-settings package and refactor the config (can be done in a separate PR). |
looking at Using Another interesting aspect is our The above will cause some dependency resolution issues with older In the end, it will be a trade-off and a bit of a jerk move to force users to upgrade their deps which may come from other dependencies. Bottom line:
support for both versions
@HammadB, any strong opinion on which option to go for? |
Given that Pydantic v2 was released in April of last year, I would vote for just bumping the version. |
I think we should preserve backwards compat here. The history of this is we actually did support this #1174 but then regressed when we changed this. |
I'm for keeping backward with 1.x. Pydantic seems to be committed to the 1.x release train (last release 1.10 was about a month ago). Also fastAPI seems to support 1.7+. Last but not least our surface area is pretty small so it is not a huge overhead to keep supporting 1.x. |
What happened?
After installed ChromaDB and run
chroma run
, it throws an error when I try to create a new index using the NodeJS client.The reason I find out is because the version of
pydantic
is too old on my machine.Mine was
1.10.12
, and upgrading the library to the latest version (2.7.1) solves this issue.It seems the version in the
requirement.txt
ispydantic>=1.9
so it doesn't upgrade the library automatically during install, should the version number gets bumped?Reference:
chroma/requirements.txt
Line 18 in b34f90c
The code that throws the error (
model_validate
does not exist on1.10
):chroma/chromadb/server/fastapi/__init__.py
Line 561 in b34f90c
Versions
Chroma v0.5.0, Python 3.9.13, MacOS 14.4.1
Relevant log output
The text was updated successfully, but these errors were encountered: