-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-5046 Support $lookup in CSFLE and QE #2210
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
Merged
+730
−15
Merged
Changes from 15 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
9306a9e
REVERT ME: modify pymongocrypt_source to test branch
sleepyStick c69c3bd
resync specs
sleepyStick 1fb56b0
add tests draft
sleepyStick ff300a9
fix typing
sleepyStick ea56a2e
revert this in the future!
sleepyStick 3ea9a25
undo changes
sleepyStick d967ffa
modify uv.lock
sleepyStick c9a4bd0
change uv.lock commit hash?
sleepyStick 590e455
still not done, but test setup runs now
sleepyStick 6e33d29
add missing await
sleepyStick 74fac79
fix test 8
sleepyStick daa420d
remove notes to self
sleepyStick 2c46edb
Revert "REVERT ME: modify pymongocrypt_source to test branch"
sleepyStick 8770445
Update uv.lock
sleepyStick 8c45daa
address comments
sleepyStick 53da94d
close clients and fix changelog
sleepyStick c85a856
delete unnecessary client.close
sleepyStick 09a82da
drop db instead of just keyvault
sleepyStick 74b338b
fix asynccleanup call
sleepyStick 7dcf8bd
fix docstring
sleepyStick File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -242,7 +242,7 @@ async def kms_request(self, kms_context: MongoCryptKmsContext) -> None: | |
) | ||
raise exc from final_err | ||
|
||
async def collection_info(self, database: str, filter: bytes) -> Optional[bytes]: | ||
async def collection_info(self, database: str, filter: bytes) -> Optional[list[bytes]]: | ||
"""Get the collection info for a namespace. | ||
|
||
The returned collection info is passed to libmongocrypt which reads | ||
|
@@ -251,14 +251,12 @@ async def collection_info(self, database: str, filter: bytes) -> Optional[bytes] | |
:param database: The database on which to run listCollections. | ||
:param filter: The filter to pass to listCollections. | ||
|
||
:return: The first document from the listCollections command response as BSON. | ||
:return: The all documents from the listCollections command response as BSON. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "The all documents" -> "All documents" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oop good catch, fixed! |
||
""" | ||
async with await self.client_ref()[database].list_collections( | ||
ShaneHarvey marked this conversation as resolved.
Show resolved
Hide resolved
|
||
filter=RawBSONDocument(filter) | ||
) as cursor: | ||
async for doc in cursor: | ||
return _dict_to_bson(doc, False, _DATA_KEY_OPTS) | ||
return None | ||
return [_dict_to_bson(doc, False, _DATA_KEY_OPTS) async for doc in cursor] | ||
|
||
def spawn(self) -> None: | ||
"""Spawn mongocryptd. | ||
|
@@ -551,7 +549,7 @@ def _create_mongocrypt_options(**kwargs: Any) -> MongoCryptOptions: | |
# For compat with pymongocrypt <1.13, avoid setting the default key_expiration_ms. | ||
if kwargs.get("key_expiration_ms") is None: | ||
kwargs.pop("key_expiration_ms", None) | ||
return MongoCryptOptions(**kwargs) | ||
return MongoCryptOptions(**kwargs, enable_multiple_collinfo=True) | ||
|
||
|
||
class AsyncClientEncryption(Generic[_DocumentType]): | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
QE.pr
->QE supported on MongoDB 8.1+.