Skip to content

Commit 9ff5a17

Browse files
authored
PYTHON-3674 Simplify transaction options in convenient API doc example code (#2230)
1 parent 711a45a commit 9ff5a17

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

test/asynchronous/test_examples.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,12 +1163,7 @@ async def callback(session):
11631163
# Step 2: Start a client session.
11641164
async with client.start_session() as session:
11651165
# Step 3: Use with_transaction to start a transaction, execute the callback, and commit (or abort on error).
1166-
await session.with_transaction(
1167-
callback,
1168-
read_concern=ReadConcern("local"),
1169-
write_concern=wc_majority,
1170-
read_preference=ReadPreference.PRIMARY,
1171-
)
1166+
await session.with_transaction(callback)
11721167

11731168
# End Transactions withTxn API Example 1
11741169

test/test_examples.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,12 +1161,7 @@ def callback(session):
11611161
# Step 2: Start a client session.
11621162
with client.start_session() as session:
11631163
# Step 3: Use with_transaction to start a transaction, execute the callback, and commit (or abort on error).
1164-
session.with_transaction(
1165-
callback,
1166-
read_concern=ReadConcern("local"),
1167-
write_concern=wc_majority,
1168-
read_preference=ReadPreference.PRIMARY,
1169-
)
1164+
session.with_transaction(callback)
11701165

11711166
# End Transactions withTxn API Example 1
11721167

0 commit comments

Comments
 (0)