Skip to content

BUMP 4.2 #1016

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 3 commits into from
Jul 20, 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
42 changes: 40 additions & 2 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,45 @@ PyMongo 4.2 brings a number of improvements including:
changes may be made before the final release. See :ref:`automatic-queryable-client-side-encryption` for example usage.
- Provisional (beta) support for :func:`pymongo.timeout` to apply a single timeout
to an entire block of pymongo operations.
- Added the ``timeoutMS`` URI and keyword argument to :class:`~pymongo.mongo_client.MongoClient`.
- Added the :attr:`pymongo.errors.PyMongoError.timeout` property which is ``True`` when
the error was caused by a timeout.
- Added ``check_exists`` option to :meth:`~pymongo.database.Database.create_collection`
- Added the ``check_exists`` argument to :meth:`~pymongo.database.Database.create_collection`
that when True (the default) runs an additional ``listCollections`` command to verify that the
collection does not exist already.
- Added the following key management APIs to :class:`~pymongo.encryption.ClientEncryption`:

- :meth:`~pymongo.encryption.ClientEncryption.get_key`
- :meth:`~pymongo.encryption.ClientEncryption.get_keys`
- :meth:`~pymongo.encryption.ClientEncryption.delete_key`
- :meth:`~pymongo.encryption.ClientEncryption.add_key_alt_name`
- :meth:`~pymongo.encryption.ClientEncryption.get_key_by_alt_name`
- :meth:`~pymongo.encryption.ClientEncryption.remove_key_alt_name`
- :meth:`~pymongo.encryption.ClientEncryption.rewrap_many_data_key`
- :class:`~pymongo.encryption.RewrapManyDataKeyResult`

- Support for the ``crypt_shared`` library to replace ``mongocryptd`` using the new
``crypt_shared_lib_path`` and ``crypt_shared_lib_required`` arguments to
:class:`~pymongo.encryption_options.AutoEncryptionOpts`.

Bug fixes
.........

- Fixed a bug where :meth:`~pymongo.collection.Collection.estimated_document_count`
would fail with a "CommandNotSupportedOnView" error on views (`PYTHON-2885`_).
- Fixed a bug where invalid UTF-8 strings could be passed as patterns for :class:`~bson.regex.Regex`
objects (`PYTHON-3048`_). :func:`bson.encode` now correctly raises :class:`bson.errors.InvalidStringData`.
objects. :func:`bson.encode` now correctly raises :class:`bson.errors.InvalidStringData` (`PYTHON-3048`_).
- Fixed a bug that caused ``AutoReconnect("connection pool paused")`` errors in the child
process after fork (`PYTHON-3257`_).
- Fixed a bug where :meth:`~pymongo.collection.Collection.count_documents` and
:meth:`~pymongo.collection.Collection.distinct` would fail in a transaction with
``directConnection=True`` (`PYTHON-3333`_).
- GridFS no longer uploads an incomplete files collection document after encountering an
error in the middle of an upload fork. This results in fewer
:class:`~gridfs.errors.CorruptGridFile` errors (`PYTHON-1552`_).
- Renamed PyMongo's internal C extension methods to avoid crashing due to name conflicts
with mpi4py and other shared libraries (`PYTHON-2110`_).
- Fixed tight CPU loop for network I/O when using PyOpenSSL (`PYTHON-3187`_).

Unavoidable breaking changes
............................
Expand All @@ -38,6 +64,11 @@ Unavoidable breaking changes
Users of the Stable API with estimated_document_count are recommended to upgrade
their server version to 5.0.9+ or set :attr:`pymongo.server_api.ServerApi.strict`
to ``False`` to avoid encountering errors (`PYTHON-3167`_).
- Removed generic typing from :class:`~pymongo.client_session.ClientSession` to improve
support for Pyright (`PYTHON-3283`_).
- Added ``__all__`` to the bson, pymongo, and gridfs packages. This could be a breaking
change for apps that relied on ``from bson import *`` to import APIs not present in
``__all__`` (`PYTHON-3311`_).

.. _count: https://mongodb.com/docs/manual/reference/command/count/

Expand All @@ -50,6 +81,13 @@ in this release.
.. _PYTHON-3048: https://jira.mongodb.org/browse/PYTHON-3048
.. _PYTHON-2885: https://jira.mongodb.org/browse/PYTHON-2885
.. _PYTHON-3167: https://jira.mongodb.org/browse/PYTHON-3167
.. _PYTHON-3257: https://jira.mongodb.org/browse/PYTHON-3257
.. _PYTHON-3333: https://jira.mongodb.org/browse/PYTHON-3333
.. _PYTHON-1552: https://jira.mongodb.org/browse/PYTHON-1552
.. _PYTHON-2110: https://jira.mongodb.org/browse/PYTHON-2110
.. _PYTHON-3283: https://jira.mongodb.org/browse/PYTHON-3283
.. _PYTHON-3311: https://jira.mongodb.org/browse/PYTHON-3311
.. _PYTHON-3187: https://jira.mongodb.org/browse/PYTHON-3187
.. _PyMongo 4.2 release notes in JIRA: https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&version=33196
.. _Queryable Encryption: automatic-queryable-client-side-encryption

Expand Down
2 changes: 1 addition & 1 deletion pymongo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
.. _text index: http://mongodb.com/docs/manual/core/index-text/
"""

version_tuple: Tuple[Union[int, str], ...] = (4, 2, 0, ".dev2")
version_tuple: Tuple[Union[int, str], ...] = (4, 2, 0)


def get_version_string() -> str:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
except ImportError:
_HAVE_SPHINX = False

version = "4.2.0.dev2"
version = "4.2.0"

f = open("README.rst")
try:
Expand Down