-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-2859 Add BSON Binary subtype 7 #763
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
Conversation
bson/binary.py
Outdated
@@ -23,6 +23,8 @@ | |||
|
|||
This is the default subtype for binary data. | |||
""" | |||
COLUMN_SUBTYPE = 0x07 | |||
"""BSON binary subtype for columns""" |
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.
A few comments:
- The constants in this file are defined in increasing order. Please move this down below MD5_SUBTYPE.
- please use 7 instead of 0x07 since none of the other constants use hex.
- For the docstring, it should end in a period. Please also add a
versionadded
. - Please check
doc/api/bson/binary.rst
to see if we need to update the docs as well.
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.
Done.
@@ -169,6 +169,11 @@ class UuidRepresentation: | |||
"""BSON binary subtype for an MD5 hash. | |||
""" | |||
|
|||
COLUMN_SUBTYPE = 7 | |||
"""BSON binary subtype for columns. | |||
.. versionadded:: 4.0 |
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.
Please check that the docs render correctly: https://pymongo--763.org.readthedocs.build/en/763/api/bson/binary.html
In this case there is a missing new line.
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.
Done.
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
Turns out the spec changes have already been added into pymongo. So all that is left is to add the constant.