]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
orm.exc.NoResultFound => exc.NoResultFound (#12509)
authorInada Naoki <songofacandy@gmail.com>
Tue, 8 Apr 2025 20:43:25 +0000 (05:43 +0900)
committerGitHub <noreply@github.com>
Tue, 8 Apr 2025 20:43:25 +0000 (22:43 +0200)
* s/orm.exc.NoResultFound/exc.NoResultFound/

* use _exc

lib/sqlalchemy/engine/result.py
lib/sqlalchemy/ext/asyncio/scoping.py
lib/sqlalchemy/ext/asyncio/session.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/scoping.py
lib/sqlalchemy/orm/session.py

index d550d8c44165be01b7e5a264da46b97c4b4b4e74..38db2e10309aafb1409eebc43b4a9265ca61a276 100644 (file)
@@ -1513,8 +1513,8 @@ class Result(_WithKeys, ResultInternal[Row[Unpack[_Ts]]]):
     def one(self) -> Row[Unpack[_Ts]]:
         """Return exactly one row or raise an exception.
 
-        Raises :class:`.NoResultFound` if the result returns no
-        rows, or :class:`.MultipleResultsFound` if multiple rows
+        Raises :class:`_exc.NoResultFound` if the result returns no
+        rows, or :class:`_exc.MultipleResultsFound` if multiple rows
         would be returned.
 
         .. note::  This method returns one **row**, e.g. tuple, by default.
index 823c354f3f4144aab67c37cc95c6a8ea65877fe1..6fbda514206186fe8bb9444e74ef8b6177d72b07 100644 (file)
@@ -1223,8 +1223,7 @@ class async_scoped_session(Generic[_AS]):
             Proxied for the :class:`_asyncio.AsyncSession` class on
             behalf of the :class:`_asyncio.scoping.async_scoped_session` class.
 
-        Raises ``sqlalchemy.orm.exc.NoResultFound`` if the query selects
-        no rows.
+        Raises :class:`_exc.NoResultFound` if the query selects no rows.
 
         ..versionadded: 2.0.22
 
index 17be0c8409ebd273f198772edc5e0f0693dec144..62ccb7c930f85d25a382d99fdb9fa47c7124f86f 100644 (file)
@@ -631,8 +631,7 @@ class AsyncSession(ReversibleProxy[Session]):
         """Return an instance based on the given primary key identifier,
         or raise an exception if not found.
 
-        Raises ``sqlalchemy.orm.exc.NoResultFound`` if the query selects
-        no rows.
+        Raises :class:`_exc.NoResultFound` if the query selects no rows.
 
         ..versionadded: 2.0.22
 
index 5619ab1ecd2ead627c6861f13c0f77881304d11d..63065eca63267bc0b24857542b922573c4acad25 100644 (file)
@@ -2836,11 +2836,10 @@ class Query(
     def one(self) -> _T:
         """Return exactly one result or raise an exception.
 
-        Raises ``sqlalchemy.orm.exc.NoResultFound`` if the query selects
-        no rows.  Raises ``sqlalchemy.orm.exc.MultipleResultsFound``
-        if multiple object identities are returned, or if multiple
-        rows are returned for a query that returns only scalar values
-        as opposed to full identity-mapped entities.
+        Raises :class:`_exc.NoResultFound` if the query selects no rows.
+        Raises :class:`_exc.MultipleResultsFound` if multiple object identities
+        are returned, or if multiple rows are returned for a query that returns
+        only scalar values as opposed to full identity-mapped entities.
 
         Calling :meth:`.one` results in an execution of the underlying query.
 
@@ -2860,7 +2859,7 @@ class Query(
     def scalar(self) -> Any:
         """Return the first element of the first result or None
         if no rows present.  If multiple rows are returned,
-        raises MultipleResultsFound.
+        raises :class:`_exc.MultipleResultsFound`.
 
           >>> session.query(Item).scalar()
           <Item>
index ba9899a5f96ff5ae3c99be81257d34916e55f848..27cd734ea612574ff45acadc8e69222c00e807d7 100644 (file)
@@ -1116,8 +1116,7 @@ class scoped_session(Generic[_S]):
             Proxied for the :class:`_orm.Session` class on
             behalf of the :class:`_orm.scoping.scoped_session` class.
 
-        Raises ``sqlalchemy.orm.exc.NoResultFound`` if the query
-        selects no rows.
+        Raises :class:`_exc.NoResultFound` if the query selects no rows.
 
         For a detailed documentation of the arguments see the
         method :meth:`.Session.get`.
index 2896ebe2f9ac490567ee3e2fa273576265a6ec4b..bb64bbc3f7674754da4b390c3d5e4a433e362563 100644 (file)
@@ -3735,8 +3735,7 @@ class Session(_SessionClassMethods, EventTarget):
         """Return exactly one instance based on the given primary key
         identifier, or raise an exception if not found.
 
-        Raises ``sqlalchemy.orm.exc.NoResultFound`` if the query
-        selects no rows.
+        Raises :class:`_exc.NoResultFound` if the query selects no rows.
 
         For a detailed documentation of the arguments see the
         method :meth:`.Session.get`.