Return the first row. Equivalent to :meth:`_query.Query.first`.
(self)
| 448 | return None |
| 449 | |
| 450 | def first(self): |
| 451 | """Return the first row. |
| 452 | |
| 453 | Equivalent to :meth:`_query.Query.first`. |
| 454 | |
| 455 | """ |
| 456 | |
| 457 | bq = self.bq.with_criteria(lambda q: q.slice(0, 1)) |
| 458 | return ( |
| 459 | bq.for_session(self.session) |
| 460 | .params(self._params) |
| 461 | ._using_post_criteria(self._post_criteria) |
| 462 | ._iter() |
| 463 | .first() |
| 464 | ) |
| 465 | |
| 466 | def one(self): |
| 467 | """Return exactly one result or raise an exception. |
nothing calls this directly
no test coverage detected