Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rework upsert flow to handle all errors from API #170

Merged
merged 3 commits into from
Jan 22, 2024

Conversation

hemidactylus
Copy link
Collaborator

Fixes #159 .

The errors in CI (apart from timeouts and such) are due to the "ordered=false" default - unrelated to this PR - #169 takes care of them.

@hemidactylus
Copy link
Collaborator Author

@amorton FYI, and thank you for surfacing this missing error handling in the flow!

"$vector": [10, 11, 999, -153],
}
with pytest.raises(ValueError):
_ = await async_writable_vector_collection.upsert(document0b)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_ = await async_writable_vector_collection.upsert(document0b)
await async_writable_vector_collection.upsert(document0b)

"$vector": [10, 11, 999, -153],
}
with pytest.raises(ValueError):
_ = await async_writable_vector_collection.upsert(document1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_ = await async_writable_vector_collection.upsert(document1)
await async_writable_vector_collection.upsert(document1)

"$vector": [10, 11, 999, -153],
}
with pytest.raises(ValueError):
_ = writable_vector_collection.upsert(document0b)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_ = writable_vector_collection.upsert(document0b)
writable_vector_collection.upsert(document0b)

"$vector": [10, 11, 999, -153],
}
with pytest.raises(ValueError):
_ = writable_vector_collection.upsert(document1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_ = writable_vector_collection.upsert(document1)
writable_vector_collection.upsert(document1)

Copy link
Collaborator

@cbornet cbornet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hemidactylus hemidactylus merged commit 0855889 into master Jan 22, 2024
2 checks passed
@hemidactylus hemidactylus deleted the fix/#159-SL-fix-upsert-errors branch January 22, 2024 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

upsert() function does not correctly handle errors
3 participants