-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 2.3
-
Component/s: None
-
None
The following code crashes with
AttributeError: 'AsyncIOMotorClientSession' object has no attribute '_txn_read_preference'
changing `session=s` to `session=s.delegate` fixes the issue
import asyncio import motor.motor_asyncio async def main(): client = motor.motor_asyncio.AsyncIOMotorClient() async with await client.start_session() as s: async with client.db.collection.watch(session=s) as change_stream: async for change in change_stream: print(change) asyncio.run(main())
- is related to
-
MOTOR-642 Reject passing raw pymongo ClientSessions to motor methods
- Backlog