Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2555,7 +2555,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"]
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/resync-specs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ do
uri|uri*options)
cpjson uri-options/tests uri_options
;;
versioned-api)
stable-api)
cpjson versioned-api/tests versioned-api
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we wait until the spec changes get merged so that we can update this line as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just remove this change and merge.

;;
*)
Expand Down
4 changes: 2 additions & 2 deletions doc/api/pymongo/server_api.rst
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down
2 changes: 1 addition & 1 deletion pymongo/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ def command(
.. 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
Expand Down
6 changes: 3 additions & 3 deletions pymongo/mongo_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,12 +516,12 @@ def __init__(
- ``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>`_.
Expand Down
2 changes: 1 addition & 1 deletion pymongo/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ def unpin(self):

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.
Copy link
Contributor Author

@juliusgeo juliusgeo Feb 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@behackett see @blink1073's comment above about the other instances of Versioned API--I excluded those because the ticket says it's a docs change. Do comments fall under that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well to avoid confusion from future maintainers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.

# 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)])
Expand Down
14 changes: 7 additions & 7 deletions pymongo/server_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -27,9 +27,9 @@
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
Expand All @@ -44,7 +44,7 @@
: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.

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,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.
Expand Down