Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nodes/test/mocks/chromadb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def get(
count += 1

# Apply limit
if limit and len(results["ids"]) >= limit:
if limit is not None and len(results["ids"]) >= limit:
break

return results
Expand Down
4 changes: 2 additions & 2 deletions nodes/test/mocks/psycopg2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def _handle_semantic_search(self, query: str, params: Tuple):
query_vector = p.tolist()
elif isinstance(p, (list, tuple)) and len(p) > 3:
query_vector = list(p)
elif isinstance(p, int) and p < 1000:
elif isinstance(p, int) and not isinstance(p, bool) and p < 1000:
limit = p
else:
filter_params.append(p)
Expand Down Expand Up @@ -305,7 +305,7 @@ def _extract_limit(self, query: str, params: Tuple) -> Optional[int]:
if "limit" in query.lower() and params:
# Last param is often the limit
for p in reversed(params):
if isinstance(p, int) and p < 10000:
if isinstance(p, int) and not isinstance(p, bool) and p < 10000:
return p
return None

Expand Down
2 changes: 1 addition & 1 deletion nodes/test/mocks/weaviate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def near_vector(
))

# Sort by distance (lower is better for cosine distance)
results.sort(key=lambda x: x.metadata.distance if x.metadata.distance else 1.0)
results.sort(key=lambda x: x.metadata.distance if x.metadata.distance is not None else 1.0)

return QueryResult(objects=results[:limit])

Expand Down
Loading