Summary
embedding_studio/data_access/mongo/mongo_dao.py:127 calls
self.model.schema() in get_model_property_names(). BaseModel.schema() has
been deprecated since pydantic 2.0.0 and emits a PydanticDeprecatedSince20
DeprecationWarning on every call (verified on pydantic 2.13.4).
The project pins pydantic = "2.5.2", so every call to this method emits the
warning.
Impact
- A
DeprecationWarning on every call to get_model_property_names(), which
is invoked for each Mongo collection mapping.
- These methods are scheduled for removal in a future pydantic major release
(3.0); migrating now avoids a later break.
Suggested fix
Replace .schema() with .model_json_schema(), which returns the same JSON
schema and is available since pydantic 2.0.0:
# before
schema = self.model.schema()
return set(schema["properties"].keys())
# after
schema = self.model.model_json_schema()
return set(schema["properties"].keys())
Summary
embedding_studio/data_access/mongo/mongo_dao.py:127callsself.model.schema()inget_model_property_names().BaseModel.schema()hasbeen deprecated since pydantic 2.0.0 and emits a
PydanticDeprecatedSince20DeprecationWarningon every call (verified on pydantic 2.13.4).The project pins
pydantic = "2.5.2", so every call to this method emits thewarning.
Impact
DeprecationWarningon every call toget_model_property_names(), whichis invoked for each Mongo collection mapping.
(3.0); migrating now avoids a later break.
Suggested fix
Replace
.schema()with.model_json_schema(), which returns the same JSONschema and is available since pydantic 2.0.0: