MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _parse

Method _parse

lib/sqlalchemy/sql/elements.py:4728–4752  ·  view source on GitHub ↗
(
        cls,
        range_: _FrameIntTuple | FrameClause | None,
        coerce_int: bool,
    )

Source from the content-addressed store, hash-verified

4726
4727 @classmethod
4728 def _parse(
4729 cls,
4730 range_: _FrameIntTuple | FrameClause | None,
4731 coerce_int: bool,
4732 ) -> FrameClause | None:
4733 if range_ is None or isinstance(range_, FrameClause):
4734 return range_
4735
4736 try:
4737 r0, r1 = range_
4738 except (ValueError, TypeError) as ve:
4739 raise exc.ArgumentError(
4740 "2-tuple expected for range/rows/groups"
4741 ) from ve
4742
4743 l_b, l_t = cls._handle_int(r0, coerce_int)
4744 u_b, u_t = cls._handle_int(r1, coerce_int)
4745
4746 return FrameClause(
4747 start=l_b,
4748 end=u_b,
4749 start_frame_type=l_t,
4750 end_frame_type=u_t,
4751 _validate=False,
4752 )
4753
4754
4755class AggregateOrderBy(WrapsColumnExpression[_T]):

Callers 1

__init__Method · 0.80

Calls 2

FrameClauseClass · 0.85
_handle_intMethod · 0.80

Tested by

no test coverage detected