]> 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)
committerFederico Caselli <cfederico87@gmail.com>
Tue, 8 Apr 2025 20:45:05 +0000 (22:45 +0200)
* s/orm.exc.NoResultFound/exc.NoResultFound/

* use _exc

(cherry picked from commit d5a913c8aefad763539f8fd88b99118bcabb19a2)

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 3c81fc605204c023e1501e4e6170d3c515a2d65f..ed099da05d1e290f8fe2a5ec4cd6a2cfe16db9c9 100644 (file)
@@ -1489,8 +1489,8 @@ class Result(_WithKeys, ResultInternal[Row[_TP]]):
     def one(self) -> Row[_TP]:
         """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 7ecab37b400192e22890c6c0c7a29b1a09c51ce7..d2a9a51b231817a6a486ea221a45857da80a072e 100644 (file)
@@ -1175,8 +1175,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 1b8c9695c7f03c654a98e621eb2920fe0560238b..68cbb59bfd62fa9c20a930990434aac46e1b2c46 100644 (file)
@@ -628,8 +628,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 af496b245f481bd2ce79667f10b2b5ef6fe86cce..3489c15fd6f56e236e20cbf1b03c691062a4f9d1 100644 (file)
@@ -2787,11 +2787,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.
 
@@ -2811,7 +2810,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 a0e9f17e4fa61793965a2d1f6ef0c68e0ce01bd9..df5a6534dce87d9c78d283cdff56803cfc6ee86c 100644 (file)
@@ -1086,8 +1086,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 6cd7cd63390e082472b2700766761db6c31c97f5..f8ad6fa6a4b3e1cde291fb5f093aa8a09403c253 100644 (file)
@@ -3718,8 +3718,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`.