Merge branch 'master' of github.com:mongodb/mongo-python-driver

This commit is contained in:
Steven Silvester 2024-04-16 05:31:01 -05:00
commit c096fc9b03
No known key found for this signature in database
GPG Key ID: B1BF5EC3A8B32F91
4 changed files with 15 additions and 7 deletions

View File

@ -43,7 +43,8 @@ PyMongo 4.7 brings a number of improvements including:
creating vector search indexes in MongoDB Atlas.
- Fixed a bug where ``read_concern`` and ``write_concern`` were improperly added to
:meth:`~pymongo.collection.Collection.list_search_indexes` queries.
- Deprecated :attr:`pymongo.write_concern.WriteConcern.wtimeout` and :attr:`pymongo.mongo_client.MongoClient.wTimeoutMS`.
Use :meth:`~pymongo.timeout` instead.
Unavoidable breaking changes
............................

View File

@ -603,7 +603,7 @@ An application using GCP credentials would look like:
}
client_encryption.create_data_key("gcp", master_key)
The driver will query the `VM instance metadata <https://cloud.google.com/compute/docs/metadata/default-metadata-values>`_ to obtain credentials.
The driver will query the `VM instance metadata <https://cloud.google.com/compute/docs/metadata/querying-metadata>`_ to obtain credentials.
An application using Azure credentials would look like, this time using
:class:`~pymongo.encryption_options.AutoEncryptionOpts`:

View File

@ -439,8 +439,8 @@ class MongoClient(common.BaseObject, Generic[_DocumentType]):
primary (e.g. w=3 means write to the primary and wait until
replicated to **two** secondaries). Passing w=0 **disables write
acknowledgement** and all other write concern options.
- `wTimeoutMS`: (integer) Used in conjunction with `w`. Specify a value
in milliseconds to control how long to wait for write propagation
- `wTimeoutMS`: **DEPRECATED** (integer) Used in conjunction with `w`.
Specify a value in milliseconds to control how long to wait for write propagation
to complete. If replication does not complete in the given
timeframe, a timeout exception is raised. Passing wTimeoutMS=0
will cause **write operations to wait indefinitely**.
@ -717,6 +717,9 @@ class MongoClient(common.BaseObject, Generic[_DocumentType]):
Not::
client.__my_database__
.. versionchanged:: 4.7
Deprecated parameter ``wTimeoutMS``, use :meth:`~pymongo.timeout`.
"""
doc_class = document_class or dict
self.__init_kwargs: dict[str, Any] = {

View File

@ -38,9 +38,9 @@ class WriteConcern:
replicated to **two** secondaries). **w=0 disables acknowledgement
of write operations and can not be used with other write concern
options.**
:param wtimeout: (integer) Used in conjunction with `w`. Specify a value
in milliseconds to control how long to wait for write propagation
to complete. If replication does not complete in the given
:param wtimeout: (integer) **DEPRECATED** Used in conjunction with `w`.
Specify a value in milliseconds to control how long to wait for write
propagation to complete. If replication does not complete in the given
timeframe, a timeout exception is raised.
:param j: If ``True`` block until write operations have been committed
to the journal. Cannot be used in combination with `fsync`. Write
@ -51,6 +51,10 @@ class WriteConcern:
server is running with journaling, this acts the same as the `j`
option, blocking until write operations have been committed to the
journal. Cannot be used in combination with `j`.
.. versionchanged:: 4.7
Deprecated parameter ``wtimeout``, use :meth:`~pymongo.timeout`.
"""
__slots__ = ("__document", "__acknowledged", "__server_default")