-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Cosmos] bugfix: set automaticIdGeneration to false properly for upsert_item()
calls
#24150
[Cosmos] bugfix: set automaticIdGeneration to false properly for upsert_item()
calls
#24150
Conversation
* Removed some stuff * Looking at constructors * Updated request * Added client close * working client creation Co-authored-by: simorenoh <[email protected]>
database read works, but ignored exception is returned: Fatal error on SSL transport NoneType has no attribute 'send' (_loop._proactor.send) RuntimeError: Event loop is closed Unclosed connector/ connection
Added methods needed to use async with when initializing client, but logs output "Exception ignored... Runtime Error: Event loop is closed"
Move branch into local fork
missing upsert and other resources
missing read_all_items and both query methods for container class
Complete item CRUD functionality - only missing queries
Query functionality and container query methods
also fixed README and added examples_async
API change check for API changes are not detected in this pull request for |
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. I'm somewhat curious why if the service supports an auto-generated ID the SDK doesn't, but clearly this was not the intended behavior in the SDK.
/azp run python - cosmos - ci |
Azure Pipelines successfully started running 1 pipeline(s). |
Update Error Code to string (Azure#24150)
Seems like this option wasn't being parsed properly due to wrong naming, which was allowing for the creation of items with auto-generated id's through the use of
upsert_item()
method. This is wrong behavior.With these changes the backend successfully throws errors when users upsert items without an 'id' field in the body. The parsing was happening in _cosmos_client_connection.py, _GetContainerIdWithPathForItem method, and was always being ignored since the option was not being properly set in the upsert_item call.
Marked it as a breaking change since this may have allowed users to create items in the past without passing in an 'id' field in their item bodies - which would now no longer be possible.