first() one()

Page not found — SQLAlchemy 1.3 Documentation

first()
Return the first result of this Query or None if the result doesn’t contain any row.
This results in an execution of the underlying query.

one()
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 rows are selected.
This results in an execution of the underlying query.

oneは行がない場合、複数行の場合は例外となる