Skip to content

Commit

Permalink
check for none instead of truth for optional array arguments (#408)
Browse files Browse the repository at this point in the history
  • Loading branch information
schwebke authored May 8, 2023
1 parent f9b8f7c commit eba0db3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chromadb/api/models/Collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ def query(
validate_where_document(where_document) if where_document else None
)
query_embeddings = (
maybe_cast_one_to_many(query_embeddings) if query_embeddings else None
maybe_cast_one_to_many(query_embeddings) if query_embeddings is not None else None
)
query_texts = maybe_cast_one_to_many(query_texts) if query_texts else None
query_texts = maybe_cast_one_to_many(query_texts) if query_texts is not None else None
include = validate_include(include, allow_distances=True)

# If neither query_embeddings nor query_texts are provided, or both are provided, raise an error
Expand Down

0 comments on commit eba0db3

Please sign in to comment.