Skip to content
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

MOTOR-946 Deprecated APIs will not be Removed in Motor 3.0 #168

Merged
merged 2 commits into from Apr 26, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/developer-guide.rst
Expand Up @@ -45,7 +45,7 @@ See the ``frameworks/tornado`` and ``frameworks/asyncio`` modules.
list above are not used internally in Motor. Instead of being removed
from the codebase, they have been left in a deprecated state to avoid
breaking any libraries built on top of Motor. These deprecated functions
will be removed in Motor 3.0.
may be removed in a future major release.

A framework-specific class, like ``MotorClient`` for Tornado or
``AsyncIOMotorClient`` for asyncio, is created by the
Expand Down
12 changes: 6 additions & 6 deletions motor/core.py
Expand Up @@ -1324,8 +1324,8 @@ def fetch_next(self):
.. _`gen.coroutine`: http://tornadoweb.org/en/stable/gen.html
"""
warnings.warn(
"The fetch_next property is deprecated and will be "
"removed in Motor 3.0. Use `async for` to iterate "
"The fetch_next property is deprecated and may be "
"removed in a future major release. Use `async for` to iterate "
"over Cursor objects instead.",
DeprecationWarning,
stacklevel=2,
Expand All @@ -1348,16 +1348,16 @@ def next_object(self):
"""**DEPRECATED** - Get a document from the most recently fetched
batch, or ``None``. See :attr:`fetch_next`.

The :meth:`next_object` method is deprecated and will be removed
in Motor 3.0. Use `async for` to elegantly iterate over
The :meth:`next_object` method is deprecated and may be removed
in a future major release. Use `async for` to elegantly iterate over
:class:`MotorCursor` objects instead.

.. versionchanged:: 2.2
Deprecated.
"""
warnings.warn(
"The next_object method is deprecated and will be "
"removed in Motor 3.0. Use Use `async for` to iterate "
"The next_object method is deprecated and may be "
"removed in a future major release. Use `async for` to iterate "
"over Cursor objects instead.",
DeprecationWarning,
stacklevel=2,
Expand Down
2 changes: 1 addition & 1 deletion motor/frameworks/asyncio/__init__.py
Expand Up @@ -147,7 +147,7 @@ async def _wrapper(self, *args, **kwargs):

def yieldable(future):
warnings.warn(
"The yieldable function is deprecated and will be removed in Motor 3.0",
"The yieldable function is deprecated and may be removed in a future major release",
DeprecationWarning,
stacklevel=2,
)
Expand Down
2 changes: 1 addition & 1 deletion motor/frameworks/tornado/__init__.py
Expand Up @@ -129,7 +129,7 @@ async def _wrapper(self, *args, **kwargs):

def yieldable(future):
warnings.warn(
"The yieldable function is deprecated and will be removed in Motor 3.0",
"The yieldable function is deprecated and may be removed in a future major release.",
DeprecationWarning,
stacklevel=2,
)
Expand Down
1 change: 1 addition & 0 deletions motor/motor_gridfs.py
Expand Up @@ -42,6 +42,7 @@ class AgnosticGridOutCursor(AgnosticCursor):

def next_object(self):
"""**DEPRECATED** - Get next GridOut object from cursor."""
# Note: the super() call will raise a warning for the deprecation.
grid_out = super().next_object()
if grid_out:
grid_out_class = create_class_with_framework(
Expand Down