Skip to content

PYTHON-2680 Breaking changes to DBRef BSON+JSON decoding #722

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
merged 10 commits into from
Sep 10, 2021

Conversation

ShaneHarvey
Copy link
Member

@ShaneHarvey ShaneHarvey commented Sep 7, 2021

Still TODO:

@ShaneHarvey ShaneHarvey marked this pull request as ready for review September 9, 2021 00:47
@@ -202,7 +202,10 @@ def _get_object(data, view, position, obj_end, opts, dummy):
obj = _elements_to_dict(data, view, position + 4, end, opts)

position += obj_size
if "$ref" in obj:
# If DBRef validation fails, return a normal doc.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the breaking DBRef BSON decoding change.

if "$ref" in dct:
if (isinstance(dct.get('$ref'), str) and
"$id" in dct and
isinstance(dct.get('$db'), (str, type(None)))):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the breaking DBRef JSON decoding change.

@ShaneHarvey ShaneHarvey changed the title PYTHON-2680 Breaking changes to DBRef BSON+JSON encoding/decoding PYTHON-2680 Breaking changes to DBRef BSON+JSON decoding Sep 10, 2021
@ShaneHarvey ShaneHarvey merged commit afa3997 into mongodb:master Sep 10, 2021
@ShaneHarvey
Copy link
Member Author

@juliusgeo I've merged this without waiting for your review but please take a look through this change anyway. Feel free to ask any questions you might have.

juliusgeo pushed a commit to juliusgeo/mongo-python-driver that referenced this pull request Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants