-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-4786 - Fix UpdateResult.did_upsert TypeError #1878
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
Changes from 1 commit
5cca021
3fc288e
edca524
49e656c
e55dd63
d5c9cd3
86589c7
d8894cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,9 +171,10 @@ def upserted_id(self) -> Any: | |
|
||
@property | ||
def did_upsert(self) -> bool: | ||
"""Whether or not an upsert took place.""" | ||
"""Whether an upsert took place.""" | ||
assert self.__raw_result is not None | ||
return len(self.__raw_result.get("upserted", {})) > 0 | ||
result = self.__raw_result.get("upserted") | ||
return result is not None and len(str(result)) > 0 | ||
|
||
|
||
|
||
class DeleteResult(_WriteResult): | ||
|
Uh oh!
There was an error while loading. Please reload this page.
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.
Please add
.. versionadded:: 4.9