Skip to content

Commit db7e9f6

Browse files
committed
Remove valitador get_pymongo_index_model.
1 parent 608d923 commit db7e9f6

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

django_mongodb_backend/indexes.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,16 +222,10 @@ def get_pymongo_index_model(
222222
field_path = column_prefix + model._meta.get_field(field_name).column
223223
mappings = {"path": field_path}
224224
if isinstance(field_, ArrayField):
225-
try:
226-
vector_size = int(field_.size)
227-
except (ValueError, TypeError) as err:
228-
raise ValueError("Atlas vector search requires size.") from err
229-
if not isinstance(field_.base_field, FloatField | DecimalField):
230-
raise ValueError("Base type must be Float or Decimal.")
231225
mappings.update(
232226
{
233227
"type": "vector",
234-
"numDimensions": vector_size,
228+
"numDimensions": int(field_.size),
235229
"similarity": next(similarities),
236230
}
237231
)

0 commit comments

Comments
 (0)