Skip to content

Commit d0772f2

Browse files
authored
PYTHON-4773 - Async PyMongo Beta docs update (#1868)
1 parent 2ddd16d commit d0772f2

File tree

11 files changed

+60
-2
lines changed

11 files changed

+60
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
:mod:`change_stream` -- Watch changes on a collection, database, or cluster
22
===========================================================================
33

4+
.. warning:: This API is currently in beta, meaning the classes, methods,
5+
and behaviors described within may change before the full release.
6+
If you come across any bugs during your use of this API,
7+
please file a Jira ticket in the "Python Driver" project at https://jira.mongodb.org/browse/PYTHON.
8+
49
.. automodule:: pymongo.asynchronous.change_stream
510
:members:
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
:mod:`client_session` -- Logical sessions for sequential operations
22
===================================================================
33

4+
.. warning:: This API is currently in beta, meaning the classes, methods,
5+
and behaviors described within may change before the full release.
6+
If you come across any bugs during your use of this API,
7+
please file a Jira ticket in the "Python Driver" project at https://jira.mongodb.org/browse/PYTHON.
8+
49
.. automodule:: pymongo.asynchronous.client_session
510
:members:

doc/api/pymongo/asynchronous/collection.rst

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
:mod:`collection` -- Collection level operations
22
================================================
33

4+
.. warning:: This API is currently in beta, meaning the classes, methods,
5+
and behaviors described within may change before the full release.
6+
If you come across any bugs during your use of this API,
7+
please file a Jira ticket in the "Python Driver" project at https://jira.mongodb.org/browse/PYTHON.
8+
49
.. automodule:: pymongo.asynchronous.collection
510
:synopsis: Collection level operations
611

Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
:mod:`command_cursor` -- Tools for iterating over MongoDB command results
22
=========================================================================
33

4+
.. warning:: This API is currently in beta, meaning the classes, methods,
5+
and behaviors described within may change before the full release.
6+
If you come across any bugs during your use of this API,
7+
please file a Jira ticket in the "Python Driver" project at https://jira.mongodb.org/browse/PYTHON.
8+
49
.. automodule:: pymongo.asynchronous.command_cursor
510
:synopsis: Tools for iterating over MongoDB command results
611
:members:

doc/api/pymongo/asynchronous/cursor.rst

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
:mod:`cursor` -- Tools for iterating over MongoDB query results
22
===============================================================
33

4+
.. warning:: This API is currently in beta, meaning the classes, methods,
5+
and behaviors described within may change before the full release.
6+
If you come across any bugs during your use of this API,
7+
please file a Jira ticket in the "Python Driver" project at https://jira.mongodb.org/browse/PYTHON.
8+
49
.. automodule:: pymongo.asynchronous.cursor
510
:synopsis: Tools for iterating over MongoDB query results
611

doc/api/pymongo/asynchronous/database.rst

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
:mod:`database` -- Database level operations
22
============================================
33

4+
.. warning:: This API is currently in beta, meaning the classes, methods,
5+
and behaviors described within may change before the full release.
6+
If you come across any bugs during your use of this API,
7+
please file a Jira ticket in the "Python Driver" project at https://jira.mongodb.org/browse/PYTHON.
8+
49
.. automodule:: pymongo.asynchronous.database
510
:synopsis: Database level operations
611

doc/api/pymongo/asynchronous/index.rst

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
:mod:`pymongo async` -- Async Python driver for MongoDB
22
=======================================================
33

4+
.. warning:: This API is currently in beta, meaning the classes, methods,
5+
and behaviors described within may change before the full release.
6+
If you come across any bugs during your use of this API,
7+
please file a Jira ticket in the "Python Driver" project at https://jira.mongodb.org/browse/PYTHON.
8+
49
.. automodule:: pymongo.asynchronous
510
:synopsis: Asynchronous Python driver for MongoDB
611

doc/api/pymongo/asynchronous/mongo_client.rst

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
:mod:`mongo_client` -- Tools for connecting to MongoDB
22
======================================================
33

4+
.. warning:: This API is currently in beta, meaning the classes, methods,
5+
and behaviors described within may change before the full release.
6+
If you come across any bugs during your use of this API,
7+
please file a Jira ticket in the "Python Driver" project at https://jira.mongodb.org/browse/PYTHON.
8+
49
.. automodule:: pymongo.asynchronous.mongo_client
510
:synopsis: Tools for connecting to MongoDB
611

doc/changelog.rst

+8-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,18 @@ Changes in Version 4.9.0
77
.. warning:: Driver support for MongoDB 3.6 reached end of life in April 2024.
88
PyMongo 4.9 will be the last release to support MongoDB 3.6.
99

10+
.. warning:: PyMongo 4.9 refactors a large portion of internal APIs to support the new asynchronous API beta.
11+
As a result, versions of Motor older than 3.6 are not compatible with PyMongo 4.9.
12+
Existing users of these versions must either upgrade to Motor 3.6 and PyMongo 4.9,
13+
or cap their PyMongo version to ``< 4.9``.
14+
Any applications that use private APIs may also break as a result of these internal changes.
15+
1016
PyMongo 4.9 brings a number of improvements including:
1117

1218
- Added support for MongoDB 8.0.
1319
- Added support for Python 3.13.
14-
- A new asynchronous API with full asyncio support.
20+
- A new beta asynchronous API with full asyncio support.
21+
This new asynchronous API is a work-in-progress that may change during the beta period before the full release.
1522
- Added support for In-Use Encryption range queries with MongoDB 8.0.
1623
Added :attr:`~pymongo.encryption.Algorithm.RANGE`.
1724
``sparsity`` and ``trim_factor`` are now optional in :class:`~pymongo.encryption_options.RangeOpts`.

pymongo/asynchronous/mongo_client.py

+2
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ def __init__(
177177
For more details, see the relevant section of the PyMongo 4.x migration guide:
178178
:ref:`pymongo4-migration-direct-connection`.
179179
180+
.. warning:: This API is currently in beta, meaning the classes, methods, and behaviors described within may change before the full release.
181+
180182
The client object is thread-safe and has connection-pooling built in.
181183
If an operation fails because of a network error,
182184
:class:`~pymongo.errors.ConnectionFailure` is raised and the client

tools/synchro.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@
119119
be passed as options for the create collection command.""",
120120
}
121121

122+
docstring_removals: set[str] = {
123+
".. warning:: This API is currently in beta, meaning the classes, methods, and behaviors described within may change before the full release."
124+
}
125+
122126
type_replacements = {"_Condition": "threading.Condition"}
123127

124128
import_replacements = {"test.synchronous": "test"}
@@ -322,7 +326,12 @@ def translate_docstrings(lines: list[str]) -> list[str]:
322326
docstring_replacements[k], # type: ignore[index]
323327
)
324328

325-
return lines
329+
for line in docstring_removals:
330+
if line in lines[i]:
331+
lines[i] = "DOCSTRING_REMOVED"
332+
lines[i + 1] = "DOCSTRING_REMOVED"
333+
334+
return [line for line in lines if line != "DOCSTRING_REMOVED"]
326335

327336

328337
def unasync_directory(files: list[str], src: str, dest: str, replacements: dict[str, str]) -> None:

0 commit comments

Comments
 (0)