Commit Graph

463 Commits

Author SHA1 Message Date
Shane Harvey
3504130322
PYTHON-4663 Fix coverity warnings in datetime decoding change (#1835) 2024-09-05 11:28:49 -07:00
Shane Harvey
a4645f0f8b
PYTHON-4712 Improve BSON encoding/decoding docs (#1823) 2024-08-30 13:36:40 -07:00
Shane Harvey
a2059dc9cb
PYTHON-4663 Fix compatibility with dateutil timezones (#1812) 2024-08-28 14:20:55 -07:00
Shane Harvey
28697df6f8
PYTHON-4691 Fix non-UTC timezones with DATETIME_CLAMP/DATETIME_AUTO (#1811) 2024-08-28 11:39:03 -07:00
Steven Silvester
fd0787a57b
PYTHON-4615 Address sign-compare warning, improve array_of_documents_to_buffer validation (#1804) 2024-08-27 19:05:15 -05:00
Shane Harvey
4eae7d2d94
PYTHON-4690 Add repr for FixedOffset eg FixedOffset(datetime.timedelta(seconds=3600), '+60')) (#1806) 2024-08-23 09:50:05 -07:00
Shane Harvey
8939ea359c
PYTHON-4640 Improve performance of creating ObjectIds with multiple threads (#1781) 2024-08-08 19:34:39 -07: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
Shane Harvey
724186700f
PYTHON-3741 Fix rendering of CodecOptions links in docs (#1595) 2024-04-16 11:29:27 -07:00
Shane Harvey
add6a30766
PYTHON-4285 Fix PyModule_GetState check (#1565) 2024-03-29 10:09:29 -07:00
Shane Harvey
372b5d68d5
PYTHON-4305 Fix bson size check (#1564) 2024-03-27 18:51:23 -05:00
Shane Harvey
ec4cb3ee55
PYTHON-4285 More consistent PyModule_GetState checks (#1560) 2024-03-25 13:48:45 -07:00
Shane Harvey
a8b8dab04a
PYTHON-3745 Add support for multiphase initialization (#1499)
Co-authored-by: Steven Silvester <steven.silvester@ieee.org>
2024-02-16 10:44:13 -08:00
Shane Harvey
7d6635b56c
PYTHON-3847 Encode DatetimeMS using type_marker lookup (#1524) 2024-02-16 10:43:57 -08:00
Noah Stapp
ebb94b669e
PYTHON-3457 Easier debugging with standardized logging (#1515)
PYTHON-3458 Add command logging.
PYTHON-3459 Add server selection logging.
PYTHON-3473 Add connection pool logging.
PYTHON-4167 Add documentation and examples.

Co-authored-by: sleepyStick <itsirisho@gmail.com>
2024-02-15 11:35:08 -08:00
Shane Harvey
4c2e717b9f
PYTHON-4204 Optimize JSON decoding using lookup table to find $ keys (#1512) 2024-02-06 16:18:31 -08:00
ilukyanchikov
97b9a333c8
PYTHON-4179: Optimize JSON decoding performance by avoiding object_pairs_hook (#1493) 2024-02-05 13:59:14 -08:00
Shane Harvey
b8d6bfdf08
PYTHON-4144 Optimize json_util encoding performance using single dispatch table (#1475) 2024-01-18 11:43:36 -08:00
Shane Harvey
cd3f502de6
PYTHON-4143 Optimize JSON encoding of int, float, str, and None (#1474) 2024-01-12 12:59:15 -08:00
Shane Harvey
72663deb33
PYTHON-4142 json_util.default should always convert Int64 (#1473) 2024-01-12 10:57:54 -08:00
Noah Stapp
f67e9ae207
PYTHON-1374 Optimize json_util performance (#1460) 2024-01-11 16:44:38 -08:00
Jib
60d0761527
PYTHON-2884: Replaced SON usage in all internal classes and commands (#1426) 2023-12-19 15:42:23 -08:00
Noah Stapp
9d32a09e30
PYTHON-4084 Fix BSON inflation for DBRef (#1458) 2023-12-12 13:00:14 -08:00
Noah Stapp
568a3b1294
PYTHON-4084 Fix BSON inflation for RawBSONDocument (#1456) 2023-12-08 10:08:41 -08: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
923c8a5abe
PYTHON-4024 Use ruff formatter (#1419) 2023-11-02 12:46:40 -05: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
Jib
c9f8829749
PYTHON-3855: Appends suggestion Use CodecOptions into errorhandler for datetime conversions (#1349)
* first commit, appends suggestion into errorhandler

* catch only ArithmeticErrors, scoped try clause, and using raise _ from

* fixed unused import

* formatting

* stepped through each logical call to ensure functional parity; added refactoring suggestions

* Revert "stepped through each logical call to ensure functional parity; added refactoring suggestions"

This reverts commit 77e99c97d6.
I took PYTHON-3739 and accidentally super-imposed it onto this one. Reverting to fix

* place the msg check in the excxeption handle

* cleaned up some code callsites. applied refactor changes. made a more generic error checking test

* edited code comment

* Update test/test_bson.py

rename just to retrigger test suite

* DECREF -> XDECREF and formatting
2023-08-23 11:34:07 -04:00
Iris
0d44783edd
PYTHON-3821 use overload pattern for _DocumentType (#1352) 2023-08-10 16:46:41 -07: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
Iris
4d42931823
PYTHON-3820 Optimize PyObject_CallMethod calls (#1314) 2023-07-19 09:03:45 -07:00
Shane Harvey
70da43ffe8
PYTHON-3846 Faster int encoding (#1311) 2023-07-17 14:40:27 -04:00
Shane Harvey
469e2e95f5
PYTHON-3511 Cleanup some more Python 2 references (#1309) 2023-07-14 17:02:24 -04:00
Soroush Mahdavi
c6a6ea6066
PYTHON-3511 Remove Python 2 references from the docs (#1161)
Co-authored-by: Nicky Lee <40870742+iceypotato@users.noreply.github.com>
Co-authored-by: DanielZavala11 <89770626+DanielZavala11@users.noreply.github.com>
Co-authored-by: Shane Harvey <shane.harvey@mongodb.com>
2023-07-14 15:30:14 -04:00
Iris
992df04da6
PYTHON-3831 remove _DocumentIn (#1308) 2023-07-14 11:12:58 -07:00
Iris
3f9e722e01
PYTHON-3824 Optimize BSON encoding of standard Python list and tuples (#1302) 2023-07-13 14:29:00 -07:00
Iris
7bcbb0de9b
PYTHON-3802 add types to database.py (#1295) 2023-07-12 10:48:33 -07:00
Iris
9a4911fca6
PYTHON-3817 Optimize BSON encoding of standard Python dict (#1301) 2023-07-11 12:32:56 -07:00
Iris
f813f56362
PYTHON-3803 add types to encryption.py (#1296) 2023-07-11 08:24:15 -07:00
Iris
5a8f422b9f
PYTHON-3816 use Use PyObject_GetItem instead of PyMapping_GetItemString (#1294) 2023-07-07 12:27:35 -07:00
Iris
7e96249212
PYTHON-3797 cache commonly used strings (#1292) 2023-07-06 08:26:21 -07:00
Iris
0b5bdccf3a
PYTHON-3729 use PyObject_GetAddr instead of PyObject_GetAddrString (#1281) 2023-07-03 09:15:04 -07:00
stephan-hof
8b23204408
PYTHON-3758 Support overflow integers in fallback_encoder. (#1243)
bson only supports 64-bit integer within range:
[-9_223_372_036_854_775_807, +9_223_372_036_854_775_807]

This change calls the fallback_encoder before raising OverflowError on
integers outside of this range.
2023-06-26 15:20:01 -04:00
Noah Stapp
df07641687
PYTHON-2523 Remove unneeded bson-stdint-win32.h (#1253) 2023-06-21 16:25:58 -07:00
Iris
f7874fb110
PYTHON-2287 Improve error message for invalid boolean option (#1236) 2023-06-15 11:54:20 -07:00
Noah Stapp
bcfdd200c3
PYTHON-3702 bson datetime utc import cleanup (#1233) 2023-06-15 08:57:50 -07:00
Noah Stapp
ec3437849e
PYTHON-3702 Stop using utcnow and utcfromtimestamp (#1229) 2023-06-12 15:43:30 -07:00
Shane Harvey
3f687f71fb
PYTHON-3443 Remove redundant code to avoid Coverity warnings (#1228) 2023-06-12 12:41:59 -07:00