Return the first row. Equivalent to :meth:`_query.Query.first`.
(self)
| 437 | return None |
| 438 | |
| 439 | def first(self): |
| 440 | """Return the first row. |
| 441 | |
| 442 | Equivalent to :meth:`_query.Query.first`. |
| 443 | |
| 444 | """ |
| 445 | |
| 446 | bq = self.bq.with_criteria(lambda q: q.slice(0, 1)) |
| 447 | return ( |
| 448 | bq.for_session(self.session) |
| 449 | .params(self._params) |
| 450 | ._using_post_criteria(self._post_criteria) |
| 451 | ._iter() |
| 452 | .first() |
| 453 | ) |
| 454 | |
| 455 | def one(self): |
| 456 | """Return exactly one result or raise an exception. |
nothing calls this directly
no test coverage detected