Skip to content
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

PYTHON-4670 Fix handling of AsyncMongoCryptCallback.fetch_keys #879

Merged
merged 4 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ functions:
binary: bash
env:
TOPOLOGY: replica_set
MONGODB_VERSION: "8.0"
args:
- ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
- command: "subprocess.exec"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ async def run_state_machine(ctx, callback):
ctx.complete_mongo_operation()
elif state == lib.MONGOCRYPT_CTX_NEED_MONGO_KEYS:
key_filter = ctx.mongo_operation()
for key in await callback.fetch_keys(key_filter):
async for key in callback.fetch_keys(key_filter):
ctx.add_mongo_operation_result(key)
ctx.complete_mongo_operation()
elif state == lib.MONGOCRYPT_CTX_NEED_KMS:
Expand Down
3 changes: 2 additions & 1 deletion bindings/python/test/test_mongocrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,8 @@ async def mark_command(self, ns, cmd):
return self.mongocryptd_reply

async def fetch_keys(self, filter):
return self.key_docs
for doc in self.key_docs:
yield doc

async def insert_data_key(self, data_key):
raise NotImplementedError
Expand Down
Loading