]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
de-link LegacyRow, LegacyCursorResult
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 1 Nov 2021 16:45:23 +0000 (12:45 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 1 Nov 2021 16:45:23 +0000 (12:45 -0400)
Change-Id: I4a9d210c3cb07fc1d59643463acef95f9cc9b12e

doc/build/changelog/changelog_14.rst
doc/build/changelog/migration_14.rst
doc/build/changelog/migration_20.rst
doc/build/core/connections.rst

index a99a2d13f8c62120f4ecaa4ae62cec5d9b1d2c6d..30b04b8229fa93c2f1323c344b640f323a6a1d5c 100644 (file)
@@ -1752,7 +1752,7 @@ This document details individual issue-level changes made throughout
         as well as any other non-migrated applications. Previously, this would
         raise :class:`.ResourceClosedException` unconditionally in the same way as
         it does when attempting to fetch rows. While this is the correct behavior
-        going forward, the :class:`_cursor.LegacyCursorResult` object will now in
+        going forward, the ``LegacyCursorResult`` object will now in
         this case return an empty list for ``.keys()`` as it did in 1.3, while also
         emitting a 2.0 deprecation warning. The :class:`_cursor.CursorResult`, used
         when using a 2.0-style "future" engine, will continue to raise as it does
@@ -2463,7 +2463,7 @@ This document details individual issue-level changes made throughout
         works as it would with a dictionary, rather than raising ``TypeError`` as
         would be the case with a tuple, whether or not the C extensions are in
         place. This was originally supposed to emit a 2.0 deprecation warning for
-        the "non-future" case using :class:`_result.LegacyRow`, and was to raise
+        the "non-future" case using ``LegacyRow``, and was to raise
         ``TypeError`` for the "future" :class:`_result.Row` class. However, the C
         version of :class:`_result.Row` was failing to raise this ``TypeError``,
         and to complicate matters, the :meth:`_orm.Session.execute` method now
@@ -2474,12 +2474,12 @@ This document details individual issue-level changes made throughout
 
         Therefore, in order to soften the overall upgrade scheme as most users have
         not been exposed to the more strict behavior of :class:`_result.Row` up
-        through 1.4.6, :class:`_result.LegacyRow` and :class:`_result.Row` both
+        through 1.4.6, ``LegacyRow`` and :class:`_result.Row` both
         provide for string-key access as well as support for ``dict(row)``, in all
         cases emitting the 2.0 deprecation warning when ``SQLALCHEMY_WARN_20`` is
         enabled. The :class:`_result.Row` object still uses tuple-like behavior for
         ``__contains__``, which is probably the only noticeable behavioral change
-        compared to :class:`_result.LegacyRow`, other than the removal of
+        compared to ``LegacyRow``, other than the removal of
         dictionary-style methods ``values()`` and ``items()``.
 
     .. change::
@@ -2962,7 +2962,7 @@ This document details individual issue-level changes made throughout
 
         Restored the :class:`_engine.ResultProxy` name back to the
         ``sqlalchemy.engine`` namespace. This name refers to the
-        :class:`_engine.LegacyCursorResult` object.
+        ``LegacyCursorResult`` object.
 
     .. change::
         :tags: bug, orm
@@ -3170,7 +3170,7 @@ This document details individual issue-level changes made throughout
         and ``index`` will be served as tuple values if the named tuple includes
         those names; if they are absent, then their behavior as methods of
         ``collections.abc.Sequence`` is maintained. Therefore the
-        :class:`_result.Row` and :class:`_result.LegacyRow` classes have been fixed
+        :class:`_result.Row` and ``LegacyRow`` classes have been fixed
         so that they work in this same way, maintaining the expected behavior for
         database rows that have columns named "index" or "count".
 
@@ -6150,7 +6150,7 @@ This document details individual issue-level changes made throughout
         Python-level value processors have been simplified, particularly as it impacts the
         format of the C code, so that a DBAPI row is processed into a result tuple
         up front.   The object returned by the :class:`_engine.ResultProxy` is now the
-        :class:`.LegacyRow` subclass, which maintains mapping/tuple hybrid behavior,
+        ``LegacyRow`` subclass, which maintains mapping/tuple hybrid behavior,
         however the base :class:`.Row` class now behaves more fully like a named
         tuple.
 
@@ -6167,7 +6167,7 @@ This document details individual issue-level changes made throughout
         Core :class:`.Row` class, which behaves in the same way as KeyedTuple.
         In SQLAlchemy 2.0, both Core and ORM will return result rows using the same
         :class:`.Row` object.   In the interim, Core uses a backwards-compatibility
-        class :class:`.LegacyRow` that maintains the former mapping/tuple hybrid
+        class ``LegacyRow`` that maintains the former mapping/tuple hybrid
         behavior used by "RowProxy".
 
         .. seealso::
index cca8c7e0e76c6ae4313a7f675fe98b4e0f492ed2..f1e56b391e258879cad0966039a14449c4782a41 100644 (file)
@@ -1348,17 +1348,17 @@ patterns in place in order to support this process.   The note in
 :ref:`change_4710_orm` describes the ORM's use of the :class:`.Row` class.
 
 For release 1.4, the :class:`.Row` class provides an additional subclass
-:class:`.LegacyRow`, which is used by Core and provides a backwards-compatible
+``LegacyRow``, which is used by Core and provides a backwards-compatible
 version of :class:`.RowProxy` while emitting deprecation warnings for those API
 features and behaviors that will be moved.  ORM :class:`_query.Query` now makes use
 of :class:`.Row` directly as a replacement for :class:`.KeyedTuple`.
 
-The :class:`.LegacyRow` class is a transitional class where the
+The ``LegacyRow`` class is a transitional class where the
 ``__contains__`` method is still testing against the keys, not the values,
 while emitting a deprecation warning when the operation succeeds.
 Additionally, all the other mapping-like methods on the previous
-:class:`.RowProxy` are deprecated, including :meth:`.LegacyRow.keys`,
-:meth:`.LegacyRow.items`, etc.  For mapping-like behaviors from a :class:`.Row`
+:class:`.RowProxy` are deprecated, including ``LegacyRow.keys()``,
+``LegacyRow.items()``, etc.  For mapping-like behaviors from a :class:`.Row`
 object, including support for these methods as well as a key-oriented
 ``__contains__`` operator, the API going forward will be to first access a
 special attribute :attr:`.Row._mapping`, which will then provide a complete
@@ -1377,7 +1377,7 @@ The biggest cross-incompatible difference is the behavior of ``__contains__``::
     "id" in row          # True for a mapping, False for a named tuple
     "some name" in row   # False for a mapping, True for a named tuple
 
-In 1.4, when a :class:`.LegacyRow` is returned by a Core result set, the above
+In 1.4, when a ``LegacyRow`` is returned by a Core result set, the above
 ``"id" in row`` comparison will continue to succeed, however a deprecation
 warning will be emitted.   To use the "in" operator as a mapping, use the
 :attr:`.Row._mapping` attribute::
@@ -1982,7 +1982,7 @@ The rationale is so that by SQLAlchemy 2.0, both Core and ORM SELECT statements
 will return result rows using the same :class:`.Row` object which behaves  like
 a named tuple.  Dictionary-like functionality is available from :class:`.Row`
 via the :attr:`.Row._mapping` attribute.   In the interim, Core result sets
-will make use of a :class:`.Row` subclass :class:`.LegacyRow` which maintains
+will make use of a :class:`.Row` subclass ``LegacyRow`` which maintains
 the previous dict/tuple hybrid behavior for backwards compatibility while the
 :class:`.Row` class will be used directly for ORM tuple results returned
 by the :class:`_query.Query` object.
index 79e198d09c4b47a684b9f42dcfc40948f1fcb263..f2752b3def60c38ad0cf30e1410ec5cc1df9857c 100644 (file)
@@ -260,12 +260,12 @@ the SQLAlchemy project itself, the approach taken is as follows:
 
         import warnings
         from sqlalchemy import exc
-        
+
         # for warnings not included in regex-based filter below, just log
         warnings.filterwarnings(
           "always", category=exc.RemovedIn20Warning
         )
-        
+
         # for warnings related to execute() / scalar(), raise
         for msg in [
             r"The (?:Executable|Engine)\.(?:execute|scalar)\(\) function",
@@ -852,7 +852,7 @@ selecting rows from the :class:`_query.Query` object has been replaced by the
 back with Core statement results when using the
 :paramref:`_sa.create_engine.future` flag with :class:`_engine.Engine` (when
 the :paramref:`_sa.create_engine.future` flag is not set, Core result sets use
-the :class:`.LegacyRow` subclass, which maintains backwards-compatible
+the ``LegacyRow`` subclass, which maintains backwards-compatible
 behaviors for the ``__contains__()`` method; ORM exclusively uses the
 :class:`.Row` class directly).
 
index 28d332203b686ae023dc7f7350c7e7cf06bce564..1139e9224c663ad09645caca2ef841d5049db23b 100644 (file)
@@ -2060,9 +2060,6 @@ Result Set  API
 .. autoclass:: IteratorResult
     :members:
 
-.. autoclass:: LegacyRow
-    :members:
-
 .. autoclass:: MergedResult
     :members:
 
@@ -2086,9 +2083,6 @@ Result Set  API
     :inherited-members:
     :exclude-members: memoized_attribute, memoized_instancemethod
 
-.. autoclass:: LegacyCursorResult
-    :members:
-
 .. autoclass:: Row
     :members:
     :private-members: _asdict, _fields, _mapping