Skip to content

Commit a4cc954

Browse files
fix: resolve Pydantic model_name field conflict warning
Add protected_namespaces=() to CacheEntry model config to resolve UserWarning about field 'model_name' conflicting with protected namespace 'model_'. Fixes #371 Co-authored-by: Andrew Brookins <[email protected]>
1 parent fe6b8be commit a4cc954

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

redisvl/extensions/cache/embeddings/schema.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from typing import Any, Dict, List, Optional
88

9-
from pydantic import BaseModel, Field, model_validator
9+
from pydantic import BaseModel, ConfigDict, Field, model_validator
1010

1111
from redisvl.extensions.constants import EMBEDDING_FIELD_NAME, METADATA_FIELD_NAME
1212
from redisvl.utils.utils import current_timestamp, deserialize, serialize
@@ -15,6 +15,8 @@
1515
class CacheEntry(BaseModel):
1616
"""Embedding cache entry data model"""
1717

18+
model_config = ConfigDict(protected_namespaces=())
19+
1820
entry_id: str
1921
"""Cache entry identifier"""
2022
text: str

0 commit comments

Comments
 (0)