Skip to content

Commit 527c4d5

Browse files
Fixed bug in return value of SodaOperation.replaceOne().
1 parent 1cad058 commit 527c4d5

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

doc/src/release_notes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ Thin Mode Changes
3636
Thick Mode Changes
3737
++++++++++++++++++
3838

39+
#) Fixed bug in return value of :meth:`SodaOperation.replaceOne()`.
40+
3941
Common Changes
4042
++++++++++++++
4143

src/oracledb/impl/thick/soda.pyx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ cdef class ThickSodaCollImpl(BaseSodaCollImpl):
432432
_raise_from_odpi()
433433
if return_doc:
434434
return output_doc_impl
435+
return replaced
435436

436437
def save(self, ThickSodaDocImpl doc_impl, str hint, bint return_doc):
437438
"""

tests/test_3400_soda_collection.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ def test_3403_replace_document(self):
117117
content = {"name": "John", "address": {"city": "Sydney"}}
118118
doc = coll.insertOneAndGet(content)
119119
new_content = {"name": "John", "address": {"city": "Melbourne"}}
120-
coll.find().key(doc.key).replaceOne(new_content)
120+
replaced = coll.find().key(doc.key).replaceOne(new_content)
121+
self.assertTrue(replaced)
121122
self.conn.commit()
122123
doc = coll.find().key(doc.key).getOne().getContent()
123124
self.__normalize_docs([doc])

0 commit comments

Comments
 (0)