PYTHON-2862 Remove versionchanged info for PyMongo <3.0 (#709)

This commit is contained in:
Shane Harvey 2021-08-19 10:39:26 -07:00 committed by GitHub
parent 09aef81b4a
commit 69c69a6bfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 2 additions and 104 deletions

View File

@ -928,15 +928,6 @@ def decode_all(data, codec_options=DEFAULT_CODEC_OPTIONS):
Replaced `as_class`, `tz_aware`, and `uuid_subtype` options with
`codec_options`.
.. versionchanged:: 2.7
Added `compile_re` option. If set to False, PyMongo represented BSON
regular expressions as :class:`~bson.regex.Regex` objects instead of
attempting to compile BSON regular expressions as Python native
regular expressions, thus preventing errors for some incompatible
patterns, see `PYTHON-500`_.
.. _PYTHON-500: https://jira.mongodb.org/browse/PYTHON-500
"""
data, view = get_data_and_view(data)
if not isinstance(codec_options, CodecOptions):
@ -1191,15 +1182,6 @@ class BSON(bytes):
Replaced `as_class`, `tz_aware`, and `uuid_subtype` options with
`codec_options`.
.. versionchanged:: 2.7
Added `compile_re` option. If set to False, PyMongo represented BSON
regular expressions as :class:`~bson.regex.Regex` objects instead of
attempting to compile BSON regular expressions as Python native
regular expressions, thus preventing errors for some incompatible
patterns, see `PYTHON-500`_.
.. _PYTHON-500: https://jira.mongodb.org/browse/PYTHON-500
"""
return decode(self, codec_options)

View File

@ -49,9 +49,6 @@ UUID_SUBTYPE = 4
This is the new BSON binary subtype for UUIDs. The
current default is :data:`OLD_UUID_SUBTYPE`.
.. versionchanged:: 2.1
Changed to subtype 4.
"""

View File

@ -84,25 +84,6 @@ but it will be faster as there is less recursion.
Extended JSON converter for Python built on top of
`libbson <https://github.com/mongodb/libbson>`_. `python-bsonjs` works best
with PyMongo when using :class:`~bson.raw_bson.RawBSONDocument`.
.. versionchanged:: 2.8
The output format for :class:`~bson.timestamp.Timestamp` has changed from
'{"t": <int>, "i": <int>}' to '{"$timestamp": {"t": <int>, "i": <int>}}'.
This new format will be decoded to an instance of
:class:`~bson.timestamp.Timestamp`. The old format will continue to be
decoded to a python dict as before. Encoding to the old format is no longer
supported as it was never correct and loses type information.
Added support for $numberLong and $undefined - new in MongoDB 2.6 - and
parsing $date in ISO-8601 format.
.. versionchanged:: 2.7
Preserves order when rendering SON, Timestamp, Code, Binary, and DBRef
instances.
.. versionchanged:: 2.3
Added dumps and loads helpers to automatically handle conversion to and
from json and supports :class:`~bson.binary.Binary` and
:class:`~bson.code.Code`
"""
import base64
@ -401,10 +382,6 @@ def dumps(obj, *args, **kwargs):
.. versionchanged:: 3.4
Accepts optional parameter `json_options`. See :class:`JSONOptions`.
.. versionchanged:: 2.7
Preserves order when rendering SON, Timestamp, Code, Binary, and DBRef
instances.
"""
json_options = kwargs.pop("json_options", DEFAULT_JSON_OPTIONS)
return json.dumps(_json_convert(obj, json_options), *args, **kwargs)

View File

@ -17,11 +17,7 @@
class MaxKey(object):
"""MongoDB internal MaxKey type.
.. versionchanged:: 2.7
``MaxKey`` now implements comparison operators.
"""
"""MongoDB internal MaxKey type."""
_type_marker = 127

View File

@ -17,11 +17,7 @@
class MinKey(object):
"""MongoDB internal MinKey type.
.. versionchanged:: 2.7
``MinKey`` now implements comparison operators.
"""
"""MongoDB internal MinKey type."""
_type_marker = 255

View File

@ -138,12 +138,6 @@ class Collection(common.BaseObject):
collection.__my_collection__
.. versionchanged:: 2.2
Removed deprecated argument: options
.. versionadded:: 2.1
uuid_subtype attribute
.. mongodoc:: collections
"""
super(Collection, self).__init__(
@ -1382,19 +1376,6 @@ class Collection(common.BaseObject):
expression object.
Soft deprecated the ``manipulate`` option.
.. versionchanged:: 2.7
Added ``compile_re`` option. If set to False, PyMongo represented
BSON regular expressions as :class:`~bson.regex.Regex` objects
instead of attempting to compile BSON regular expressions as Python
native regular expressions, thus preventing errors for some
incompatible patterns, see `PYTHON-500`_.
.. versionchanged:: 2.3
Added the ``tag_sets`` and ``secondary_acceptable_latency_ms``
parameters.
.. _PYTHON-500: https://jira.mongodb.org/browse/PYTHON-500
.. mongodoc:: find
"""
@ -2072,13 +2053,6 @@ class Collection(common.BaseObject):
.. versionchanged:: 3.0
The :meth:`aggregate` method always returns a CommandCursor. The
pipeline argument must be a list.
.. versionchanged:: 2.7
When the cursor option is used, return
:class:`~pymongo.command_cursor.CommandCursor` instead of
:class:`~pymongo.cursor.Cursor`.
.. versionchanged:: 2.6
Added cursor support.
.. versionadded:: 2.3
.. seealso:: :doc:`/examples/aggregation`

View File

@ -879,9 +879,6 @@ class Cursor(object):
:Parameters:
- `index`: index to hint on (as an index specifier)
.. versionchanged:: 2.8
The :meth:`~hint` method accepts the name of the index.
"""
self.__check_okay_to_chain()
self.__set_hint(index)

View File

@ -299,9 +299,6 @@ class Database(common.BaseObject):
.. versionchanged:: 3.0
Added the codec_options, read_preference, and write_concern options.
.. versionchanged:: 2.2
Removed deprecated argument: options
.. _create collection command:
https://docs.mongodb.com/manual/reference/command/create
"""
@ -588,21 +585,6 @@ class Database(common.BaseObject):
BSON regular expression to a Python regular expression object.
Added the `codec_options` parameter.
.. versionchanged:: 2.7
Added `compile_re` option. If set to False, PyMongo represented BSON
regular expressions as :class:`~bson.regex.Regex` objects instead of
attempting to compile BSON regular expressions as Python native
regular expressions, thus preventing errors for some incompatible
patterns, see `PYTHON-500`_.
.. versionchanged:: 2.3
Added `tag_sets` and `secondary_acceptable_latency_ms` options.
.. versionchanged:: 2.2
Added support for `as_class` - the class you want to use for
the resulting documents
.. _PYTHON-500: https://jira.mongodb.org/browse/PYTHON-500
.. mongodoc:: commands
"""
if read_preference is None:

View File

@ -44,9 +44,6 @@ def parse_userinfo(userinfo):
:Paramaters:
- `userinfo`: A string of the form <username>:<password>
.. versionchanged:: 2.2
Now uses `urllib.unquote_plus` so `+` characters must be escaped.
"""
if '@' in userinfo or userinfo.count(':') > 1:
raise InvalidURI("Username and password must be escaped according to "