Commit Graph

87 Commits

Author SHA1 Message Date
Iris
58f04dc3d6
PYTHON-3804 add types to errors.py (#1297) 2023-07-07 22:07:41 -07:00
Shane Harvey
0123d32a20
PYTHON-3709 Remove "beta" from Queryable Encryption Equality API (#1210) 2023-05-12 12:17:40 -07: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
Julius Park
2e6e9a8507
PYTHON-3592 createEncryptedCollection should raise a specialized exception to report the intermediate encryptedFields (#1148) 2023-02-07 10:23:59 -08:00
Shane Harvey
c43486101f
PYTHON-3291 Add PyMongoError.timeout to identify timeout related errors (#1008) 2022-07-18 15:58:20 -05:00
Steven Silvester
d2b95d1bf0
PYTHON-3336 Test Failure - test_load_balancer failing (#1000) 2022-07-08 19:40:25 -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
Shane Harvey
71a1656be0
PYTHON-2038 Remove pymongo.errors.CertificateError (#705) 2021-08-12 09:29:30 -07:00
Shane Harvey
e3a61b9ff7
PYTHON-1840 Remove waitQueueMultiple and ExceededMaxWaiters (#699) 2021-08-09 10:53:28 -07:00
Prashant Mital
0209e4a4a4
PYTHON-2571 Remove NotMasterError (#688) 2021-07-28 16:01:32 -07:00
Bernie Hackett
a94504bde9 PYTHON-2726 Document read preference quirks 2021-06-28 13:08:07 -07:00
Prashant Mital
ff6ca53328
PYTHON-2572 Introduce NotPrimaryError and deprecate NotMasterError (#646) 2021-06-22 13:24:07 -07:00
Bernie Hackett
6c2d629006 PYTHON-2133 Remove Py2 compatibility from pymongo 2021-01-19 21:15:20 -08:00
Pascal Corpet
86d58113e5
PYTHON-2438 Fix str representation of BulkWriteError (#522) 2020-11-23 09:46:33 -08:00
Shane Harvey
30523d282c
PYTHON-2415 Fix pickle support for BulkWriteError exceptions (#514) 2020-11-12 11:04:55 -08:00
Julius Park
a075eb798f
PYTHON-1787: fix NotMasterError no attribute error (#450) 2020-07-02 13:53:08 -04:00
Prashant Mital
e23d019f9e
remove unnecessary changes 2020-07-01 17:24:41 -07:00
Prashant Mital
8e3fd0040e
cruft removal 2 2020-07-01 16:49:36 -07:00
Prashant Mital
14cecab393
cleanup cruft 2020-07-01 16:47:36 -07:00
Prashant Mital
956ce3d4b0
Incorporate review changes 2020-07-01 16:47:33 -07:00
Prashant Mital
9fc7ed1e11
PYTHON-2143 Use an allow-list to determine resumable change stream errors 2020-07-01 16:43:27 -07:00
Shane Harvey
1f4123e4bf PYTHON-2123 Streaming heartbeat protocol
MongoClient now requires 2 connections and 2 threads to each MongoDB 4.4+ server.
With one connection, the server streams (or pushes) updated heartbeat info.
With the other connection, the client periodically pings the server to
establish an accurate round-trip time (RTT). This change optimizes the
discovery of server state changes such as replica set elections.

Additional changes:
- Mark server Unknown before retrying isMaster check.
- Always reset the pool _after_ marking the server unknown.
- Configure fail point before creating the client in test SpecRunner.
- Unfreeze with replSetFreeze:0 to ensure a speedy elections in test suite.
2020-07-01 14:49:46 -07:00
Julius Park
67a23429ba
PYTHON-1787: add details to OperationFailure exception and NotMasterError (#448)
PYTHON-1787-add details to OperationFailure and NotMasterError by adding a __repr__ function

https://jira.mongodb.org/browse/PYTHON-1787
2020-06-30 12:30:28 -04:00
Shane Harvey
45a7963aac PYTHON-2082 Retryable writes use the RetryableWriteError label
Use retryable write logic for transaction commit/abort.
Do not assign the TransientTransactionError label to errors outside a
transaction.
2020-05-19 10:49:28 -07:00
Bernie Hackett
5df94d08f0 PYTHON-2040 PyOpenSSL support 2020-02-06 18:03:21 -08:00
Shane Harvey
e627321c2e PYTHON-1966 Fix unicode(PyMongoError) on Python 2 2019-11-22 15:17:56 -08:00
Shane Harvey
0a1d77751f PYTHON-1942 Implement prose tests for External Key Vault 2019-08-08 20:52:28 -07:00
Shane Harvey
e6eecb06d1 PYTHON-1884 Implement auto encryption spec tests
Skip test for symbol type which pymongo converts to string.
Fix {} comparison with RawBSONDocument in command events.
Add support for $$type assertions.
Nicer message in check_events.
Support errorContains with empty string.
Move custom data files to custom/.
2019-08-06 16:17:39 -07:00
Shane Harvey
f588412b67 PYTHON-1842 Implement Connection Monitoring and Pooling spec 2019-06-13 15:50:49 -07:00
Shane Harvey
e7114087c7 PYTHON-1682 UTF-8 encode unicode error messages on Python 2 2018-11-13 17:43:57 -08:00
Shane Harvey
b5e9007af0 PYTHON-1508 PYTHON-1589 Expand where unknown commit label is raised
Remove has_label api.
Bump required server version for transactions.
2018-06-15 11:29:11 -07:00
Shane Harvey
e4317d286b PYTHON-1508 Retryable commit/abort, has_error_label api
Retryable commitTransaction/abortTransaction.
Retry writes after certain writeConcernErrors.
Add has_error_label api.
Update unacknowledged write concern error messge.
Resync transaction tests and update test runner.
2018-06-07 14:39:52 -07:00
Shane Harvey
ffcd66561f PYTHON-1508 Add has_label to temporary transaction errors 2018-04-17 16:56:01 -07:00
Bernie Hackett
507f954ed4 Update copyright dates 2017-12-01 17:23:39 -08:00
Bernie Hackett
740fc3c07a PYTHON-1033, PYTHON-1034 - Make protocol asserts exceptions
This change introduces a new exception, pymongo.errors.ProtocolError,
and uses it in place of asserts related to the wire protocol.
2016-05-19 17:18:00 -07:00
Bernie Hackett
fa4a6a39d3 PYTHON-952 - Query and getMore monitoring
This commit adds support for monitoring queries and getMore
operations, including getMore operations for command cursors
(e.g. aggregate cursor getMore). It also fixes a bug in duration
calculation.
2015-08-11 12:19:28 -07:00
Bernie Hackett
aec685b374 Fix up copyright dates. 2015-03-25 11:55:02 -07:00
aherlihy
fa1466179f PYTHON-813 Added support for serverSelectionTimeoutMS 2015-03-09 12:38:24 -07:00
Bernie Hackett
4fd6f8a0b1 PYTHON-854 max_pool_size -> maxPoolSize
With this change the max_pool_size named parameter to
MongoClient is removed. It is replaced by the maxPoolSize
MongoDB URI option, which can be passed in a URI, or as a
keyword argument to MongoClient.
2015-03-09 10:08:13 -07:00
Bernie Hackett
c800cd18ad PYTHON-837 - Implement CRUD spec exception hierarchy. 2015-02-24 13:49:39 -08:00
A. Jesse Jiryu Davis
1447ad1257 Remove pymongo.errors.UnsupportedOption. 2014-10-31 16:42:11 -04:00
A. Jesse Jiryu Davis
936ee264cb PEP 257. 2014-10-31 14:15:24 -04: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
A. Jesse Jiryu Davis
735a1247ca PYTHON-525 Deprecate MongoReplicaSetClient.
MongoClient now supports all MongoReplicaSetClient's features.
Fix bugs and add features in the new MongoClient to bring it up
to spec. MongoReplicaSetClient is now a deprecated stub that
subclasses MongoClient.

Introduce new errors, NetworkTimeout and NotMasterError, to
communicate events that MongoClient must handle specially.
2014-09-16 15:33:19 -04:00
Bernie Hackett
e3c809bd02 Gracefully kill cursor on capped rollover PYTHON-637
This change does a few things:

- Raises a new exception for CursorNotFound, inheriting from
OperationFailure so we don't break existing code.
- Catches the exception in cursor.Cursor and command_cursor.CommandCursor,
setting __killed to True.
- If the cursor is not tailable, re-raises the exception. This makes it
easier to deal with capped collection rollover when iterating a
tailable cursor.
2014-02-12 08:33:13 -08:00
A. Jesse Jiryu Davis
2fa1750b07 Update copyright notices and company name. 2014-01-31 09:36:46 -05:00
Bernie Hackett
ee9ecd05ee Introduce DocumentTooLarge exception PYTHON-630
The idea here is to unify the handling of oversize documents when using
the bulk API in MongoDB 2.6 and previous versions. This also means that
using bulk Collection.insert against legacy servers will attempt to insert
all documents previous to the oversize document before raising.
2014-01-29 12:55:49 -08:00
Bernie Hackett
36b86007e5 OperationFailure error_document -> details PYTHON-576 2014-01-24 11:10:02 -08:00