Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
spikechroma committed Aug 28, 2024
1 parent a974fda commit 08ebe9c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion chromadb/test/property/strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ def recordsets(
ids: Optional[List[types.ID]] = list(
draw(st.lists(id_strategy, min_size=min_size, max_size=max_size, unique=True))
)

n_records = len(ids)

if can_ids_be_empty and draw(st.booleans()):
Expand Down
15 changes: 10 additions & 5 deletions clients/js/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,12 @@ export async function prepareRecordRequest(
embeddingFunction: IEmbeddingFunction,
update?: true,
): Promise<MultiRecordOperationParams> {
const { ids = [], embeddings, metadatas, documents } = arrayifyParams(reqParams);
const {
ids = [],
embeddings,
metadatas,
documents,
} = arrayifyParams(reqParams);

if (!embeddings && !documents && !update) {
throw new Error("embeddings and documents cannot both be undefined");
Expand All @@ -112,8 +117,8 @@ export async function prepareRecordRequest(
const embeddingsArray = embeddings
? embeddings
: documents
? await embeddingFunction.generate(documents)
: undefined;
? await embeddingFunction.generate(documents)
: undefined;

if (!embeddingsArray && !update) {
throw new Error("Failed to generate embeddings for your request.");
Expand Down Expand Up @@ -158,8 +163,8 @@ export async function prepareRecordRequestWithIDsOptional(
const embeddingsArray = embeddings
? embeddings
: documents
? await embeddingFunction.generate(documents)
: undefined;
? await embeddingFunction.generate(documents)
: undefined;

if (!embeddingsArray) {
throw new Error("Failed to generate embeddings for your request.");
Expand Down

0 comments on commit 08ebe9c

Please sign in to comment.