-
Notifications
You must be signed in to change notification settings - Fork 21
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
Conversation
@amorton FYI, and thank you for surfacing this missing error handling in the flow! |
tests/astrapy/test_async_db_dml.py
Outdated
"$vector": [10, 11, 999, -153], | ||
} | ||
with pytest.raises(ValueError): | ||
_ = await async_writable_vector_collection.upsert(document0b) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_ = await async_writable_vector_collection.upsert(document0b) | |
await async_writable_vector_collection.upsert(document0b) |
tests/astrapy/test_async_db_dml.py
Outdated
"$vector": [10, 11, 999, -153], | ||
} | ||
with pytest.raises(ValueError): | ||
_ = await async_writable_vector_collection.upsert(document1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_ = await async_writable_vector_collection.upsert(document1) | |
await async_writable_vector_collection.upsert(document1) |
tests/astrapy/test_db_dml.py
Outdated
"$vector": [10, 11, 999, -153], | ||
} | ||
with pytest.raises(ValueError): | ||
_ = writable_vector_collection.upsert(document0b) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_ = writable_vector_collection.upsert(document0b) | |
writable_vector_collection.upsert(document0b) |
tests/astrapy/test_db_dml.py
Outdated
"$vector": [10, 11, 999, -153], | ||
} | ||
with pytest.raises(ValueError): | ||
_ = writable_vector_collection.upsert(document1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_ = writable_vector_collection.upsert(document1) | |
writable_vector_collection.upsert(document1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.