PYTHON-5111 Update datetime_conversion in docstrings of MongoClients (#2135)

This commit is contained in:
Casey Clements 2025-02-10 15:00:30 -05:00 committed by GitHub
parent c6ffa1e951
commit 7a7ffa615d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 9 deletions

View File

@ -178,7 +178,7 @@ documentation including narrative docs, and the [Sphinx docstring format](https:
You can build the documentation locally by running:
```bash
just docs-build
just docs
```
When updating docs, it can be helpful to run the live docs server as:

View File

@ -276,7 +276,9 @@ class AsyncMongoClient(common.BaseObject, Generic[_DocumentType]):
:param type_registry: instance of
:class:`~bson.codec_options.TypeRegistry` to enable encoding
and decoding of custom types.
:param datetime_conversion: Specifies how UTC datetimes should be decoded
:param kwargs: **Additional optional parameters available as keyword arguments:**
- `datetime_conversion` (optional): Specifies how UTC datetimes should be decoded
within BSON. Valid options include 'datetime_ms' to return as a
DatetimeMS, 'datetime' to return as a datetime.datetime and
raising a ValueError for out-of-range values, 'datetime_auto' to
@ -284,9 +286,6 @@ class AsyncMongoClient(common.BaseObject, Generic[_DocumentType]):
out-of-range and 'datetime_clamp' to clamp to the minimum and
maximum possible datetimes. Defaults to 'datetime'. See
:ref:`handling-out-of-range-datetimes` for details.
| **Other optional parameters can be passed as keyword arguments:**
- `directConnection` (optional): if ``True``, forces this client to
connect directly to the specified MongoDB host as a standalone.
If ``false``, the client connects to the entire replica set of

View File

@ -274,7 +274,9 @@ class MongoClient(common.BaseObject, Generic[_DocumentType]):
:param type_registry: instance of
:class:`~bson.codec_options.TypeRegistry` to enable encoding
and decoding of custom types.
:param datetime_conversion: Specifies how UTC datetimes should be decoded
:param kwargs: **Additional optional parameters available as keyword arguments:**
- `datetime_conversion` (optional): Specifies how UTC datetimes should be decoded
within BSON. Valid options include 'datetime_ms' to return as a
DatetimeMS, 'datetime' to return as a datetime.datetime and
raising a ValueError for out-of-range values, 'datetime_auto' to
@ -282,9 +284,6 @@ class MongoClient(common.BaseObject, Generic[_DocumentType]):
out-of-range and 'datetime_clamp' to clamp to the minimum and
maximum possible datetimes. Defaults to 'datetime'. See
:ref:`handling-out-of-range-datetimes` for details.
| **Other optional parameters can be passed as keyword arguments:**
- `directConnection` (optional): if ``True``, forces this client to
connect directly to the specified MongoDB host as a standalone.
If ``false``, the client connects to the entire replica set of