PYTHON-3111 Rename "Versioned API" to "Stable API" in documentation (#867)

This commit is contained in:
Julius Park 2022-02-17 16:23:23 -08:00 committed by GitHub
parent a0fe7c03af
commit f5eec45250
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 18 additions and 18 deletions

View File

@ -2561,7 +2561,7 @@ buildvariants:
tasks:
- name: atlas-data-lake-tests
- matrix_name: "versioned-api-tests"
- matrix_name: "stable-api-tests"
matrix_spec:
platform: ubuntu-18.04
python-version: ["3.6", "3.10"]

View File

@ -136,7 +136,7 @@ do
uri|uri*options)
cpjson uri-options/tests uri_options
;;
versioned-api)
stable-api)
cpjson versioned-api/tests versioned-api
;;
*)

View File

@ -1,8 +1,8 @@
:mod:`server_api` -- Support for MongoDB Versioned API
:mod:`server_api` -- Support for MongoDB Stable API
======================================================
.. automodule:: pymongo.server_api
:synopsis: Support for MongoDB Versioned API
:synopsis: Support for MongoDB Stable API
.. autoclass:: pymongo.server_api.ServerApi
:members:

View File

@ -258,7 +258,7 @@ Notable improvements
....................
- Added support for MongoDB 5.0.
- Support for MongoDB Versioned API, see :class:`~pymongo.server_api.ServerApi`.
- Support for MongoDB Stable API, see :class:`~pymongo.server_api.ServerApi`.
- Support for snapshot reads on secondaries (see :ref:`snapshot-reads-ref`).
- Support for Azure and GCP KMS providers for client side field level
encryption. See the docstring for :class:`~pymongo.mongo_client.MongoClient`,

View File

@ -686,7 +686,7 @@ class Database(common.BaseObject, Generic[_DocumentType]):
.. note:: :meth:`command` does **not** apply any custom TypeDecoders
when decoding the command response.
.. note:: If this client has been configured to use MongoDB Versioned
.. note:: If this client has been configured to use MongoDB Stable
API (see :ref:`versioned-api-ref`), then :meth:`command` will
automactically add API versioning options to the given command.
Explicitly adding API versioning options in the command and

View File

@ -515,12 +515,12 @@ class MongoClient(common.BaseObject, Generic[_DocumentType]):
- ``bypass_auto_encrpytion=False`` is passed to
:class:`~pymongo.encryption_options.AutoEncryptionOpts`
| **Versioned API options:**
| (If not set explicitly, Versioned API will not be enabled.)
| **Stable API options:**
| (If not set explicitly, Stable API will not be enabled.)
- `server_api`: A
:class:`~pymongo.server_api.ServerApi` which configures this
client to use Versioned API. See :ref:`versioned-api-ref` for
client to use Stable API. See :ref:`versioned-api-ref` for
details.
.. seealso:: The MongoDB documentation on `connections <https://dochub.mongodb.org/core/connections>`_.

View File

@ -587,7 +587,7 @@ class SocketInfo(object):
def hello_cmd(self):
# Handshake spec requires us to use OP_MSG+hello command for the
# initial handshake in load balanced or versioned api mode.
# initial handshake in load balanced or stable API mode.
if self.opts.server_api or self.hello_ok or self.opts.load_balanced:
self.op_msg_enabled = True
return SON([(HelloCompat.CMD, 1)])

View File

@ -12,11 +12,11 @@
# implied. See the License for the specific language governing
# permissions and limitations under the License.
"""Support for MongoDB Versioned API.
"""Support for MongoDB Stable API.
.. _versioned-api-ref:
MongoDB Versioned API
MongoDB Stable API
=====================
Starting in MongoDB 5.0, applications can specify the server API version
@ -27,9 +27,9 @@ version, regardless of the server's actual release version.
Declaring an API Version
````````````````````````
.. attention:: Versioned API requires MongoDB >=5.0.
.. attention:: Stable API requires MongoDB >=5.0.
To configure MongoDB Versioned API, pass the ``server_api`` keyword option to
To configure MongoDB Stable API, pass the ``server_api`` keyword option to
:class:`~pymongo.mongo_client.MongoClient`::
>>> from pymongo.mongo_client import MongoClient
@ -44,7 +44,7 @@ including those sent through the generic
:meth:`~pymongo.database.Database.command` helper.
.. note:: Declaring an API version on the
:class:`~pymongo.mongo_client.MongoClient` **and** specifying versioned
:class:`~pymongo.mongo_client.MongoClient` **and** specifying stable
API options in :meth:`~pymongo.database.Database.command` command document
is not supported and will lead to undefined behaviour.
@ -96,10 +96,10 @@ class ServerApiVersion:
class ServerApi(object):
"""MongoDB Versioned API."""
"""MongoDB Stable API."""
def __init__(self, version, strict=None, deprecation_errors=None):
"""Options to configure MongoDB Versioned API.
"""Options to configure MongoDB Stable API.
:Parameters:
- `version`: The API version string. Must be one of the values in

View File

@ -913,7 +913,7 @@ def sanitize_cmd(cmd):
cp.pop("$readPreference", None)
cp.pop("lsid", None)
if MONGODB_API_VERSION:
# Versioned api parameters
# Stable API parameters
cp.pop("apiVersion", None)
# OP_MSG encoding may move the payload type one field to the
# end of the command. Do the same here.