]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Fix `get_one` return value description
authorJochen Kupperschmidt <homework@nwsnet.de>
Sat, 14 Oct 2023 19:08:57 +0000 (15:08 -0400)
committersqla-tester <sqla-tester@sqlalchemy.org>
Sat, 14 Oct 2023 19:08:58 +0000 (15:08 -0400)
commitc94ec5f143691c99e3bbfa76945ac382f85bdd48
tree6ab2aaa36e9f0ad3b698f69797688228583e354e
parentd2ce313d3daeb2d8efd3adbd1d7e8d85796ee759
Fix `get_one` return value description

<!-- Provide a general summary of your proposed changes in the Title field above -->

### Description
<!-- Describe your changes in detail -->

The `get_one()` method is described as raising an error if no row is found instead of returning `None` (as `get()` does). Also, the return type hint prohibits `None`.

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)
-->

This pull request is:

- [x] A documentation / typographical / small typing error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #10473
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10473
Pull-request-sha: 1cd2c2a2df2c91a303e459c8f0c5dc950d8c7b39

Change-Id: Iaf69b05d99f4ed0df922f34f27be0b46c1410f7e
lib/sqlalchemy/orm/scoping.py
lib/sqlalchemy/orm/session.py