-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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-1860 Use OP_MSG for find/aggregate_raw_batches when supported #622
PYTHON-1860 Use OP_MSG for find/aggregate_raw_batches when supported #622
Conversation
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.
This PR seems outdated. @prashantmital can you push the new changes we made?
06bac45
to
42d0b4b
Compare
pymongo/message.py
Outdated
codec_options = DEFAULT_CODEC_OPTIONS.with_options( | ||
document_class=RawBSONDocument) | ||
inflated_response = _decode_selective( | ||
RawBSONDocument(self.payload_document), user_fields, codec_options) |
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.
Do we need this RawBSONDocument
here?
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.
I don't think we need _decode_selective
either. I think we can just do:
inflated_response = raw_bson._inflate_bson(self.payload_document, DEFAULT_RAW_BSON_OPTIONS)
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.
We do need _decode_selective
because we need the top-level document that this returns to be a dictionary so that we can modify nextBatch
/firstBatch
in-place in the returned inflated_response
. Else, we will need to perform a copy in _convert_raw_document_lists_to_streams
to construct a dict
.
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.
Yes but I think raw_bson._inflate_bson
does what we want here in a simpler way. Does it not?
Note these 3 test failures on "latest" are expected (I'm seeing them in other branches changes):
The others I haven't seen before and might be caused by this PR:
|
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.
LGTM. It would be nice to understand the perf impact of this change. Can you open a ticket for that?
No description provided.