Commit Graph

70 Commits

Author SHA1 Message Date
Steven Silvester
527cbdd18a
PYTHON-5537 Update typing dependencies (#2524) 2025-09-10 13:28:02 -05:00
Noah Stapp
ad16d6e880
PYTHON-4431 - Remove ReadTheDocs Documentation in Favor of Official Docs (#2459) 2025-08-07 12:06:38 -04:00
Casey Clements
4a29fbda69
PYTHON-5289 Fixes indentation in docstring of Binary.from_vector (#2432) 2025-07-15 11:27:38 -07:00
Casey Clements
1e67c5c02c
PYTHON-5289 Validate ignored bits are 0 on write for bson.BinaryVector (#2397) 2025-07-15 10:17:30 -07:00
Casey Clements
336163aaa0
PYTHON-5126 - Implemented new test cases for Binary Vector (#2393) 2025-06-18 13:35:23 -04:00
Steven Silvester
75f6a3718e
Revert "PYTHON-5126 & PYTHON-5280 Addresses issues raised in DRIVERS-3097 and DRIVERS-3123 " (#2337) 2025-05-12 09:35:08 -05:00
Casey Clements
fafa00e9e3
PYTHON-5126 & PYTHON-5280 Addresses issues raised in DRIVERS-3097 and DRIVERS-3123 (#2261) 2025-04-09 09:09:42 -04:00
Casey Clements
b66a5cb673
PYTHON-5172 bugfix: Add __repr__ and __eq__ to bson.binary.BinaryVector (#2162) 2025-03-10 15:45:32 -04:00
Casey Clements
6da1fdbed9
PYTHON-5126 Resync bson vector spec tests following additions (#2161) 2025-03-03 12:51:32 -05:00
The Light
44d1d40d65
PYTHON-5115 Type validation errors should include the invalid type name (#2085)
Co-authored-by: Iris Ho <iris.ho@mongodb.com>
2025-01-31 12:01:58 -08:00
Jib
7dba1e5dd9
PYTHON-5043: Fix list[int, float] typo in binary.py (#2066) 2025-01-21 14:37:52 -05:00
Casey Clements
466d0a188f
PYTHON-4903 Adds typing overloading to bson.binary.Binary.from_vector (#1967) 2024-11-05 10:47:36 -05:00
Casey Clements
26a61c8c48
PYTHON-2926 Updated signature of Binary.from_vector to take a BinaryVector (#1963) 2024-10-23 08:24:59 -04:00
Casey Clements
7fbeca9793
[PYTHON-4803] Big endian fix for binary bson vectors (#1885) 2024-10-01 15:06:12 -04:00
Casey Clements
ae6cfd6d10
[DRIVERS-2926] [PYTHON-4577] BSON Binary Vector Subtype Support (#1813)
Co-authored-by: Steven Silvester <steve.silvester@mongodb.com>
Co-authored-by: Steven Silvester <steven.silvester@ieee.org>
2024-09-30 21:13:09 -05:00
Terry Patterson
ac66c9dfd2
PYTHON-4468 Hide the value of sensitive subtype binary objects (#1649)
Co-authored-by: Steven Silvester <steven.silvester@ieee.org>
2024-05-30 16:44:06 -05:00
Steven Silvester
6537415da7
PYTHON-3605 Move type annotations to parameter list in rendered docs (#1441) 2023-11-27 09:24:00 -06:00
Steven Silvester
992d1507e7
PYTHON-4005 Replace flake8 and isort with ruff (#1399) 2023-10-19 11:56:22 -05:00
Steven Silvester
83ab612aa1
PYTHON-3932 Support mypy --strict testing in bson package (#1362) 2023-08-29 13:49:11 -05:00
Iris
c1d33831e8
PYTHON-3907 add --disallow-untyped-defs for mypy (#1351) 2023-08-10 11:08:36 -07:00
Noah Stapp
240a748fb2
PYTHON-3893 Add BSON Binary Data subtype Sensitive (#1335) 2023-08-02 13:07:44 -07:00
Shane Harvey
469e2e95f5
PYTHON-3511 Cleanup some more Python 2 references (#1309) 2023-07-14 17:02:24 -04:00
Shane Harvey
0092b0af79
PYTHON-2504 Run pyupgrade 3.4.0 and ruff 0.0.265 (#1196)
pyupgrade --py37-plus bson/*.py pymongo/*.py gridfs/*.py test/*.py tools/*.py test/*/*.py
ruff --fix-only --select ALL --fixable ALL --target-version py37 --line-length=100 --unfixable COM812,D400,D415,ERA001,RUF100,SIM108,D211,D212,SIM105,SIM,PT,ANN204,EM bson/*.py pymongo/*.py gridfs/*.py test/*.py test/*/*.py
2023-05-11 15:27:17 -07:00
Steven Silvester
087950d869
PYTHON-3164 Outdated link from PyMongo docs to community forum (#895) 2022-03-15 15:49:11 -05:00
Steven Silvester
a0fe7c03af
PYTHON-3120 Set up flake8 linting (#868) 2022-02-17 06:44:08 -06:00
Steven Silvester
5578999a90
PYTHON-1834 Use a code formatter (#852) 2022-02-09 06:44:28 -06:00
Steven Silvester
dd6c140d43
PYTHON-3060 Add typings to pymongo package (#831) 2022-02-02 21:12:36 -06:00
Steven Silvester
52ed5a4135
PYTHON-3052 Add Typings to PyMongo Itself (#829) 2022-01-13 16:09:48 -06:00
Julius Park
eabd2235ba
PYTHON-2859 Add BSON Binary subtype 7 (#763) 2021-10-26 14:24:27 -07:00
Shane Harvey
fb20975a1f
PYTHON-2245 Change default uuidRepresentation to UNSPECIFIED (ie disable UUID encoding by default) (#724)
This change also stops decoding both 3 and 4 subtypes as UUIDs.
With standard, only subtype 4 is decoded to UUID and subtype 3 is decoded to Binary.
With legacy representations, only subtype 3 is decoded to UUID and subtype 4 is decoded to Binary.
2021-09-14 16:48:52 -07:00
Shane Harvey
69c69a6bfb
PYTHON-2862 Remove versionchanged info for PyMongo <3.0 (#709) 2021-08-19 10:39:26 -07:00
Shane Harvey
5fd175c0d8
PYTHON-2529 Remove UUIDLegacy (#698) 2021-08-06 16:52:41 -07:00
Bernie Hackett
c70071df1d PYTHON-2133 Remove Py2 compatibility from bson 2021-01-14 14:57:20 -08:00
Prashant Mital
ff327b3e31
PYTHON-2252 Add examples and documentation for new UUID behavior (#467) 2020-07-29 14:46:48 -07:00
Prashant Mital
4760d07815
PYTHON-2152 Expand native UUID handling support; Implement UUID specification 2020-06-01 17:45:08 -07:00
Bernie Hackett
e92e2b0efb PYTHON-1648 Binary buffer protocol support 2019-07-18 08:41:40 -07:00
Bernie Hackett
2f06e8a441 PYTHON-1808 - Document uuidRepresentation 2019-04-16 16:26:09 -07:00
jakirkham
5950abf323 Clarify that Binary expects data to be bytes (#399) 2019-03-28 11:51:28 -07:00
Petr Messner
7f1939ebcb PYTHON-1642 - Replace count() with count_documents({}) in docs (#376) 2018-09-13 16:34:35 -07:00
Bernie Hackett
507f954ed4 Update copyright dates 2017-12-01 17:23:39 -08:00
Shane Harvey
e775295ab5 PYTHON-1367 Ignore uuid_representation when decoding BSON binary subtype 4. 2017-09-12 17:20:14 -07:00
Luke Lovett
3321b66d34 PYTHON-977 - Fix __hash__ method on BSON types that inherit from Python builtin types.
In Python 2, objects automatically inherit the __hash__ of their parent
class. In Python 3, objects that override __eq__ do not automatically inherit
__hash__, so these objects were not hashable under Python 3.  Additionally,
mutable BSON types and types that overide __eq__ but did not explicitly define
__hash__ had broken __hash__ methods under Python 2.  This commit unifies the
hashing behavior between Python versions and fixes the __hash__ methods such
that two BSON objects hash the same only if they are equal.

N.B.: bson.code.Code and bson.regex.Regex are no longer hashable under Python 2
because they are mutable.
2015-09-04 14:45:24 -07:00
Bernie Hackett
aec685b374 Fix up copyright dates. 2015-03-25 11:55:02 -07:00
Bernie Hackett
839893939e PYTHON-821 - Deprecated legacy API.
This commit deprecates insert, update, save, and remove. Each
now raises DeprecationWarning at stacklevel 2. This change also
updates all tutorials and example documentation to use the new
CRUD API, tests the deprecations, and fixes up a few more tests
that were still using the legacy API.
2015-02-20 15:41:45 -08:00
A. Jesse Jiryu Davis
9da835ab3d PYTHON-825 BSON API changes and internal options handling.
This change resolves four issues:

PYTHON-826 The new codec_options submodule is moved from pymongo to bson.

PYTHON-827 Use codec_options in BSON APIs.

Functions and methods of the bson module that accepted the options as_class,
tz_aware, and uuid_subtype now accept a codec_options parameter instead.

For example, the function definition for bson.decode_all changes from this:

def decode_all(data, as_class=dict, tz_aware=True,
               uuid_subtype=OLD_UUID_SUBTYPE)

to:

def decode_all(data, codec_options=CodecOptions())

The following functions are changed:

- decode_all
- decode_iter
- decode_file_iter

The following methods are changed:

- BSON.encode
- BSON.decode

This is a breaking change for any application that uses the BSON API directly
and changes any of the named parameter defaults. No changes are required for
applications that use the default values for these options. The behavior
remains the same.

PYTHON-828 Internal BSON module changes to support CodecOptions

The pure Python BSON module passes around a CodecOptions instance instead of
as_class, tz_aware, and uuid_subtype. C extensions pass these values around in
a struct.

PYTHON-801 Rename uuid_subtype to uuid_representation.
2015-02-05 23:09:23 -06:00
Bernie Hackett
a3fb2462bb PYTHON-801 - Remove BaseObject.uuid_subtype 2014-12-29 07:34:07 -08:00
Bernie Hackett
7e4ebde147 PYTHON-801 - Add STANDARD and PYTHON_LEGACY to bson.binary
And use them in place of UUID_SUBTYPE and OLD_UUID_SUBTYPE. This
change also cleans up and clarifies the documentation for
JAVA_LEGACY and CSHARP_LEGACY. None of these are binary subtypes,
but instead UUID representations in the Python, C#, and Java drivers.
2014-12-24 09:52:58 -08:00
A. Jesse Jiryu Davis
08dccbba46 Remove ancient version annotations.
Delete "versionchanged" and "versionadded" directives that predate 2.0.
2014-10-31 14:15:24 -04:00
Bernie Hackett
b26459cd6a Remove useless uuid module checks.
These were only needed for python 2.4 which does
not provide a uuid module.
2014-04-24 10:09:21 -07:00
Bernie Hackett
bd8d4a3b10 PYTHON-673 - Use bytes and remove binary_type
The binary_type alias was added to support python
2.4 and 2.5, which we no longer support.
2014-04-23 13:25:00 -07:00