Skip to content

Commit

Permalink
Update db.py
Browse files Browse the repository at this point in the history
  • Loading branch information
erichare committed Nov 10, 2023
1 parent 28527cd commit 52cdb72
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions astrapy/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ def _pre_process_find(self, vector, fields=None):
if not vector:
return ValueError("Must pass a vector")

# Edge case for field selection
if fields and "$similarity" in fields:
raise ValueError("Please use the `include_similarity` parameter")

# Build the new vector parameter
sort = {"$vector": vector}

Expand Down Expand Up @@ -342,10 +346,6 @@ def vector_find_one(
fields=None,
include_similarity=True,
):
# Edge case for field selection
if fields and "$similarity" in fields:
raise ValueError("Please use the `include_similarity` parameter")

# Pre-process the included arguments
sort, projection = self._pre_process_find(
vector,
Expand Down

0 comments on commit 52cdb72

Please sign in to comment.