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]: v0.5.5 uses Pydantic 2 features while depending on Pydantic 1 #2503

Closed
rChaoz opened this issue Jul 11, 2024 · 1 comment · Fixed by #2229
Closed

[Bug]: v0.5.5 uses Pydantic 2 features while depending on Pydantic 1 #2503

rChaoz opened this issue Jul 11, 2024 · 1 comment · Fixed by #2229
Labels
bug Something isn't working

Comments

@rChaoz
Copy link

rChaoz commented Jul 11, 2024

What happened?

I have a project still using Pydantic 1 and I recently tried upgrading chromadb-client from 0.5.4.dev0 to 0.5.5.dev0, failing with an error in types.py, which uses model_fields, a feature added in Pydantic 2:

chroma/chromadb/types.py

Lines 99 to 100 in 45aba8a

if key in self.model_fields:
return getattr(self, key)

But ChromaDB depends on Pydantic 1+:

chroma/pyproject.toml

Lines 17 to 19 in 45aba8a

dependencies = [
'build >= 1.0.3',
'pydantic >= 1.9',

Versions

ChromaDB v0.5.5, ChromaDB-Client v0.5.5-dev0

Relevant log output

collection has no attribute model_fields
@rChaoz rChaoz added the bug Something isn't working label Jul 11, 2024
@rChaoz rChaoz changed the title [Bug]: 0.5.5 uses Pydantic 2 features while still depending on Pydantic 1+ [Bug]: v0.5.5 uses Pydantic 2 features while still depending on Pydantic 1+ Jul 11, 2024
@rChaoz rChaoz changed the title [Bug]: v0.5.5 uses Pydantic 2 features while still depending on Pydantic 1+ [Bug]: v0.5.5 uses Pydantic 2 features while depending on Pydantic 1 Jul 11, 2024
@tazarov
Copy link
Contributor

tazarov commented Jul 11, 2024

@rChaoz, thanks for reporting this. We're aware of the problem and have a PR pending to make Chroma compatible with both 1.9 and 2.x - #2229

tazarov added a commit that referenced this issue Jul 24, 2024
Closes #2503
Closes #2137

## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
	 - Support for pydantic 1.x in FastAPI server.

## Test plan
*How are these changes tested?*

- [x] Tests pass locally with `pytest` for python, `yarn test` for js,
`cargo test` for rust

## Documentation Changes
N/A
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

Successfully merging a pull request may close this issue.

2 participants