Commit Graph

171 Commits

Author SHA1 Message Date
Noah Stapp
34ca694c9f
PYTHON-3801 gRPC POC phase 1 (#1317) 2023-07-26 14:01:22 -07:00
Iris
fd095955f5
PYTHON-3777 add types to command_cursor.py (#1285) 2023-07-03 15:16:33 -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
Steven Silvester
afd7e1c2cd
PYTHON-3460 Implement OIDC SASL mechanism (#1138) 2023-05-11 14:35:30 -05:00
Jean-Christophe Fillion-Robin
d340710e3d
PYTHON-3703 Fix typos and add codespell pre-commit hook (#1203)
Update pre-commit config adding "codespell" hook
2023-05-03 14:47:24 -07:00
Steven Silvester
a3720d9cea
PYTHON-3568 Intellisense highlights multiple PyMongo methods because of CodecOptions (#1139) 2023-01-25 09:41:23 -06:00
Steven Silvester
449cb8fb0f
PYTHON-2722 Improve performance of find/aggregate_raw_batches (#1047) 2022-09-22 15:14:40 -05:00
Shane Harvey
6acc9f64cf
PYTHON-3333 Fix bug where non-cursor read operations fail in a transaction with directConnection=True on primary (#991) 2022-07-06 11:39:41 -07:00
Shane Harvey
890cd26e1a
PYTHON-3288 Implement client side operation timeout (#954)
Add timeoutMS URI option and MongoClient keyword argument.
Add provisional/beta pymongo.timeout() api to set a deadline for a block of operations.
2022-06-06 15:36:52 -04:00
Steven Silvester
a319075ba7
PYTHON-3197 Update docs.mongodb.com links in source, API & Reference documentation (#926) 2022-04-13 14:11:13 -05:00
Julius Park
9562a81903
PYTHON-3119 getMore helper should explicitly send inherited comment (#904) 2022-03-25 16:47:18 -07:00
Steven Silvester
b3604a81d3
PYTHON-3171 Add usage of NoReturn annotation (#901) 2022-03-16 15:26:10 -05:00
Steven Silvester
474420b2e5
PYTHON-3085 Audit consistent and correct types for _DocumentOut (#893) 2022-03-16 05:56:07 -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
abfa0d35bc
PYTHON-3075 bulk_write does not apply CodecOptions to upserted_ids result (#840) 2022-02-02 13:53:58 -06:00
Shane Harvey
0fc82d9c7b
PYTHON-2763 Fix check_keys removal in encryption (#823) 2021-12-14 10:32:13 -08:00
Shane Harvey
ff3a8b44dc
PYTHON-1864 PYTHON-2931 Spec complaint $readPreference (#809)
Stop sending $readPreference to standalone servers.
Stop sending $readPreference primary because it's the server default.
Remove outdated secondary_ok flag.
2021-12-13 15:47:34 -08:00
Shane Harvey
797197e73b
PYTHON-2763 Remove outdated check_keys and $clusterTime logic (#817) 2021-12-10 10:22:49 -08:00
Shane Harvey
7467aa634d
PYTHON-2915 Fix bug when starting a transaction with a large bulk write (#743) 2021-09-24 15:47:37 -07:00
Shane Harvey
11752ed594
PYTHON-2899 Remove code for MongoDB <= 3.4 (#729)
Remove unneeded memoryview to bytes conversion.
2021-09-16 16:53:50 -07:00
Bernie Hackett
ad4315134c PYTHON-2803 Get rid of most uses of 'master'
This change also resolves PYTHON-2848 for MongoDB 4.0.
2021-09-13 12:50:49 -07:00
Bernie Hackett
146179db53 PYTHON-2803 Eliminate the use of 'slave' 2021-09-13 12:47:24 -07:00
Shane Harvey
369d175993
PYTHON-2430 Remove all helpers in the message module (#695) 2021-08-06 13:33:21 -07:00
Shane Harvey
a28b05bf24 PYTHON-1410 Remove "safe" legacy messages 2021-08-04 11:29:16 -07:00
Shane Harvey
01e34cebdb
PYTHON-2769 Test redaction of replies to security-sensitive commands (#676)
Resync command monitoring and unified test format tests.
Redact entire hello response when the command started contained speculativeAuthenticate.
Make OP_REPLY cursor.cursor_id always be an Int64.
2021-07-15 14:12:11 -07:00
Prashant Mital
0e0c4fd944
PYTHON-2389 Add session support to find_raw_batches and aggregate_raw_batches (#658) 2021-06-30 19:14:22 -07:00
Shane Harvey
4152600ae6
PYTHON-2777 Raise client side error for snapshot reads on <5.0 (#659) 2021-06-29 14:40:48 -07:00
Shane Harvey
14160aed04
PYTHON-2767 Support snapshot reads on secondaries (#656)
Add the MongoClient.start_session snapshot option.
2021-06-25 16:12:12 -07:00
Prashant Mital
ff6ca53328
PYTHON-2572 Introduce NotPrimaryError and deprecate NotMasterError (#646) 2021-06-22 13:24:07 -07:00
Bernie Hackett
640fee9d5d PYTHON-2556 Disable dots and dollars validation 2021-06-22 11:49:48 -07:00
Shane Harvey
c8f32a7a37 PYTHON-2673 Connection pinning behavior for load balanced clusters (#630)
Tweak spec test because pymongo unpins cursors eagerly after errors.
Tweak spec test for PoolClearedEvent ordering when MongoDB handshake fails (see DRIVERS-1785).
Only skip killCursors for some error codes.
Rely on SDAM error handling to close the connection after a state change error.
Add service_id to various events.
Retain reference to pinned sockets to prevent premptive closure by CPython's cyclic GC.
2021-06-15 14:14:56 -07:00
Prashant Mital
d26bf933ed
PYTHON-1636 Support exhaust cursors in OP_MSG (#629) 2021-05-27 17:16:50 -07:00
Prashant Mital
209d5009e6
PYTHON-1860 Use OP_MSG for find/aggregate_raw_batches when supported (#622) 2021-05-19 12:05:35 -07:00
Shane Harvey
e221b49dfc
PYTHON-2684 Send Versioned API options with getMore+txn commands (#618) 2021-05-17 15:26:50 -07:00
Prashant Mital
048ee81836
PYTHON-2719 RawBatchCursor must raise StopIteration instead of returning empty bytes when the cursor contains no results (#624) 2021-05-17 13:58:06 -07:00
Bernie Hackett
521f7b9af4 PYTHON-2133 Fix up docs
And finish deleting python 2 specific code.
2021-01-21 15:49:23 -08:00
Bernie Hackett
e17299ab2e PYTHON-2133 Remove u prefixes from code 2021-01-20 16:10:23 -08:00
Bernie Hackett
6c2d629006 PYTHON-2133 Remove Py2 compatibility from pymongo 2021-01-19 21:15:20 -08:00
Shane Harvey
ac2f506ba2
PYTHON-2453 Add MongoDB Versioned API (#536)
Add pymongo.server_api.ServerApi and the MongoClient server_api option.
Support Unified Test Format version 1.1 (serverParameters in
runOnRequirements)
Skip dropRole tests due to SERVER-53499.
2021-01-11 18:16:00 -08: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
Prashant Mital
6932d25639
PYTHON-2253 raise client-side error when allowDiskUse is specified with MongoDB <= 3.2 2020-06-08 18:25:19 -07:00
Shane Harvey
33c93223b1 PYTHON-1651 Publish CommandFailedEvent when bulk write fails with a network error 2020-05-12 14:42:27 -07:00
Shane Harvey
6e39ae04c3 PYTHON-2170 Add support for 4.4 hedged reads 2020-05-07 17:26:00 -07:00
Prashant Mital
651aa6aa98
PYTHON-2035: support for allowDiskUse in find() commands 2020-02-25 19:24:10 -08:00
Shane Harvey
228f716570 PYTHON-2059 Do not send readPreference with OP_MSG getMore commands 2019-12-03 12:29:01 -08:00
Shane Harvey
083c2474da PYTHON-2055 Subtract message header from compressed bulk OP_MSG
This change prevents pymongo from generating a bulk OP_COMPRESSED/OP_MSG
with an uncompressed message larger than the server's limit of
maxMessageSizeBytes - 16.
2019-11-14 16:24:08 -08:00
Shane Harvey
a3556c4447 PYTHON-2012 Update FLE to support commands larger than 6MiB
Bulk write command are batched at 2MiB when auto encryption is enabled.
2019-11-12 15:24:09 -08:00
Prashant Mital
f62c53f472
PYTHON-2020 Make ClientSession._in_transaction a public property 2019-11-01 16:58:38 -07:00