Closed
Description
What happened?
Starting with Pydantic 2.11 released a little over a week ago, accessing pydantic.BaseModel().model_fields
on the instance results in deprecation warnings:
import warnings
warnings.simplefilter("always")
import chromadb
chroma_client = chromadb.Client()
collection = chroma_client.get_or_create_collection(name="my_collection")
/home/philip/miniforge3/envs/ragna-dev/lib/python3.10/site-packages/chromadb/types.py:144: PydanticDeprecatedSince211: Accessing the 'model_fields' attribute on the instance is deprecated. Instead, you should access this attribute from the model class. Deprecated in Pydantic V2.11 to be removed in V3.0.
return self.model_fields # pydantic 2.x
/home/philip/miniforge3/envs/ragna-dev/lib/python3.10/site-packages/chromadb/types.py:144: PydanticDeprecatedSince211: Accessing the 'model_fields' attribute on the instance is deprecated. Instead, you should access this attribute from the model class. Deprecated in Pydantic V2.11 to be removed in V3.0.
return self.model_fields # pydantic 2.x
/home/philip/miniforge3/envs/ragna-dev/lib/python3.10/site-packages/chromadb/types.py:144: PydanticDeprecatedSince211: Accessing the 'model_fields' attribute on the instance is deprecated. Instead, you should access this attribute from the model class. Deprecated in Pydantic V2.11 to be removed in V3.0.
return self.model_fields # pydantic 2.x
/home/philip/miniforge3/envs/ragna-dev/lib/python3.10/site-packages/chromadb/types.py:144: PydanticDeprecatedSince211: Accessing the 'model_fields' attribute on the instance is deprecated. Instead, you should access this attribute from the model class. Deprecated in Pydantic V2.11 to be removed in V3.0.
return self.model_fields # pydantic 2.x
Versions
Chroma 1.0.0, pydantic 2.11