Commit Graph

2673 Commits

Author SHA1 Message Date
Bernie Hackett
99e792b6be PYTHON-677 - Update docstrings. 2014-04-22 10:32:24 -07:00
Bernie Hackett
4704bb8eb1 PYTHON-677 - Switch internals to new WriteConcern class 2014-04-21 17:13:04 -07:00
Luke Lovett
d4a94d30fd PYTHON-673 python 2/3 single-source for the bson module 2014-04-17 21:29:15 +00:00
behackett
e0b52baf8e PYTHON-672 - Make read preference a class
This commit introduces the following changes:

- Each read preference is now a class.
- Read preferences other than Primary accept a tag_sets parameter.
- The tag_sets attribute of MongoClient, Database, and Collection has
  been removed. Use the tag_sets parameter of the new classes instead.
- The read_preferences.ReadPreference constant still exists and should
continue to work as expected for most users.
2014-04-14 16:28:07 -07:00
Bernie Hackett
2f86207246 PYTHON-526 secondaryAcceptableLatencyMS changes.
- Renamed to acceptableLatencyMS since it is also used
in choosing a new mongos during mongos HA failover.
- Moved to a global immutable setting. The expectation is
that the value would be determined by a network/system
admin. Changing it per operation doesn't make a lot of
sense.

Note - it's possible the name of this option may change again
before 3.0 is released.
2014-04-08 15:27:18 -07:00
Bernie Hackett
9404ff1f12 PYTHON-525 Remove (_must)_use_master.
Left over from MasterSlaveConnection.
2014-04-07 08:31:27 -07:00
behackett
de23b63994 PYTHON-526 Remove get/set/unset_lasterror_options
Use <object>.write_concern instead.
2014-04-05 12:27:38 -07:00
Bernie Hackett
37abda5e25 PYTHON-525 Remove MasterSlaveConnection
MongoDB master/slave clusters are deprecated. Use replica
sets instead. If you must use this client class the 2.x
branch of PyMongo will continue to be maintained for some
time.
2014-04-05 10:38:51 -07:00
Bernie Hackett
814434c1b2 PYTHON-526 Remove the network_timeout query option.
This was always a misguided feature. Using a socket timeout
to "timeout" MongoDB queries is awful for a few reasons:

- It leaves the query running on the server, wasting resources.
- It causes a socket to be closed and discarded unnecessarily.
- Applications that use this tend to immediately retry the query,
often causing another timeout and more wasted resources.

There are three remaining ways to use timeouts with PyMongo:

- connectTimeoutMS - Global setting for timing out a socket's
initial connection to the server.
- socketTimeoutMS - Global setting for timing out any socket
operation. *Do not* use this to enforce time limits on server
side operations.
- max_time_ms (or maxTimeoutMS as a command kwarg) - MongoDB 2.6
server side timebomb for queries and commands. This is a server
side option, passed along with a query or command, that causes
MongoDB to abort the operation if it takes longer than the specified
limit.
2014-04-05 09:59:38 -07:00
Bernie Hackett
85db128efd PYTHON-526 Remove the "safe" option.
Use w=0 for unacknowledged write operations.
2014-04-04 17:15:50 -07:00
Bernie Hackett
e08aa1f90d PYTHON-525 Remove (ReplicaSet)Connection.
Use MongoClient or MongoReplicaSetClient instead.
2014-04-04 16:56:25 -07:00
Bernie Hackett
48a65eb9c1 PYTHON-526 Drop support for slaveOk/slave_okay.
Use any ReadPreference other than PRIMARY instead.
2014-04-04 16:37:32 -07:00
Bernie Hackett
d2cde8719a PYTHON-665 Drop support for Python 2.4, 2.5, and 3.1
If you need to continue to use any of these Python versions with MongoDB
the 2.x branch of PyMongo will continue to be minimally maintained for
some time.
2014-04-04 16:14:21 -07:00
Bernie Hackett
c9f0e89127 Version -> dev0
For 3.0 we'll start using PEP 386/440 compliant version
numbers instead of semantic versioning +.
2014-04-04 14:18:53 -07:00
Bernie Hackett
a7575fa14f BUMP 2.7 2014-04-03 11:29:31 -07:00
Bernie Hackett
2fd2efaa85 Mention the pykerberos module, which supports python 3. 2014-04-03 11:01:34 -07:00
A. Jesse Jiryu Davis
bd334626ab More lenient timeout in test_max_pool_size. 2014-04-03 12:10:42 -04:00
A. Jesse Jiryu Davis
9f7580fd61 More robust test_read_preference. 2014-04-03 09:45:54 -04:00
A. Jesse Jiryu Davis
cb101acb29 Fix race in test_request_during_failover. 2014-04-02 21:16:10 -04:00
A. Jesse Jiryu Davis
f6a0686583 Fix TestHealthMonitor.test_primary_stepdown. 2014-04-02 21:16:10 -04:00
Bernie Hackett
8054e95010 Fix auth test util. 2014-04-02 17:37:07 -07:00
A. Jesse Jiryu Davis
595c2752d6 Remove redundant Bulk API test. 2014-04-02 19:08:40 -04:00
A. Jesse Jiryu Davis
595a47f8c1 Fix --nojournal tests for MongoDB 2.6. 2014-04-02 19:08:40 -04:00
A. Jesse Jiryu Davis
4915a15218 Fix test_ship_of_theseus. 2014-04-02 17:17:16 -04:00
A. Jesse Jiryu Davis
d0fdb89875 Python 3 compatibility in test_multi_chunk_file 2014-04-01 17:03:14 -04:00
A. Jesse Jiryu Davis
974899f565 More efficient test_multi_chunk_file. 2014-04-01 16:19:35 -04:00
A. Jesse Jiryu Davis
85fe2d7353 Skip test_ident in Jython. 2014-04-01 16:18:36 -04:00
A. Jesse Jiryu Davis
f42d77a115 Skip test_use_greenlets_without_gevent on Jython. 2014-04-01 16:15:54 -04:00
A. Jesse Jiryu Davis
4b9f3ec285 More efficient test_large_limit. 2014-04-01 10:55:03 -04:00
behackett
c9affc0ae6 Use StringIO for pure python legacy batch inserts.
This reduces memory fragmentation when encoding large
batches of documents for insert. Testing shows improvements
in memory usage in pure python and reduced GC overhead in
Jython with no reduction in performance.
2014-03-31 20:02:11 -07:00
A. Jesse Jiryu Davis
7642ea2934 More detailed examples for Cursor.sort, PYTHON-663. 2014-03-28 11:52:00 -04:00
A. Jesse Jiryu Davis
e2ef986447 Compatibility with the pykerberos package.
There are two Kerberos bindings on PyPI: kerberos and pykerberos.
PyMongo has been compatible with the kerberos package since PyMongo 2.5.0. But kerberos is not currently compatible with Python 3.
This change introduces compatibility with the new pykerberos package. Since pykerberos is compatible with Python 3, PyMongo can now use Kerberos in Python 3.
2014-03-24 18:06:33 -04:00
A. Jesse Jiryu Davis
3a4d894afa Lower default GridFS chunk size to 255k, PYTHON-661. 2014-03-24 16:37:10 -04:00
Bernie Hackett
d02352c53c Improvements to ensure/create_index docs PYTHON-657 2014-03-20 11:30:10 -07:00
Bernie Hackett
3ebb4b2eb2 Fix Collection.remove docs. 2014-03-19 13:19:07 -07:00
Bernie Hackett
47b85186e7 Claim support for python 3.4 2014-03-19 13:15:25 -07:00
Bernie Hackett
cb4adb2193 Fix large update tests.
The server is less forgiving now. You can no
longer update a document to larger than 16MB.
2014-03-14 14:07:20 -07:00
Bernie Hackett
f1264ccc93 Remove unused constant.
Silences a clang warning.
2014-03-14 09:13:46 -07:00
Bernie Hackett
f1637f1ebf Work around Xcode 5.1 build issues PYTHON-654
This patch attempts to work around the unrecognized
cflag errors raised by clang 3.4 - shipped with Xcode 5.1.
2014-03-13 16:06:12 -07:00
A. Jesse Jiryu Davis
97be203bf9 Avoid "not master" error from update or remove with lazy-connecting MongoClient, PYTHON-653. 2014-03-12 14:44:28 -04:00
A. Jesse Jiryu Davis
4f230575a8 Verify that a lazily-connecting client raises OperationFailure if auth fails, PYTHON-517. 2014-03-12 14:42:35 -04:00
A. Jesse Jiryu Davis
1341fe565b Version -> + 2014-03-12 14:42:35 -04:00
Bernie Hackett
26960c8436 BUMP 2.7rc1 2014-03-11 18:12:18 -07:00
Bernie Hackett
7b5cbedb74 Minor install doc update. 2014-03-11 18:05:10 -07:00
Bernie Hackett
a4a16ac6fc Add py34 to tox.ini
PyMongo has been tested against python 3.4 rc1 - rc3. We'll
probably wait until 3.4 final to update trove classifiers.

*NOTE* - Testing with 3.4 requires nose 1.3.1 due to
https://github.com/nose-devs/nose/issues/759
2014-03-10 17:10:51 -07:00
Bernie Hackett
016fc4fc7a Better nModified handling PYTHON-647
In a sharded cluster with mixed version shards (i.e.
one shard primary is 2.6, another is 2.4 or older) the
result of one call to update could include nModified
when the next does not. Since there is no way to provide
a valid count in this case we omit the field. Make sure
you upgrade your entire cluster to MongoDB 2.6 or newer
before relying on this field.
2014-03-10 15:20:29 -07:00
A. Jesse Jiryu Davis
2538f2c403 Remove link to obsolete Django demo, PYTHON-649. 2014-03-10 17:38:30 -04:00
Bernie Hackett
9b0e542a02 Update ssl_match_hostname PYTHON-650
This brings us in sync with the code shipped in CPython 3.3.5.
2014-03-10 08:38:19 -07:00
A. Jesse Jiryu Davis
3076a2113e Race condition in GridFS test.
test_gridfs_secondary_lazy asserts that get_last_version on a secondary raises
NoFile. This fails if setUp()'s dropCollection command hasn't yet replicated:
there's still a file on the secondary.
2014-03-10 08:48:04 -04:00
A. Jesse Jiryu Davis
e4d9af2706 Fix test_write_concern_failure_ordered for 2.6. 2014-03-10 01:10:44 -04:00