Wrap a column expression as it appears in a 'reference' context. This expression is any that includes an _order_by_label_element, which is a Label, or a DESC / ASC construct wrapping a Label. The production of _label_reference() should occur when an expression is added to this cont
| 3558 | |
| 3559 | |
| 3560 | class _label_reference(ColumnElement[_T]): |
| 3561 | """Wrap a column expression as it appears in a 'reference' context. |
| 3562 | |
| 3563 | This expression is any that includes an _order_by_label_element, |
| 3564 | which is a Label, or a DESC / ASC construct wrapping a Label. |
| 3565 | |
| 3566 | The production of _label_reference() should occur when an expression |
| 3567 | is added to this context; this includes the ORDER BY or GROUP BY of a |
| 3568 | SELECT statement, as well as a few other places, such as the ORDER BY |
| 3569 | within an OVER clause. |
| 3570 | |
| 3571 | """ |
| 3572 | |
| 3573 | __visit_name__ = "label_reference" |
| 3574 | |
| 3575 | _traverse_internals: _TraverseInternalsType = [ |
| 3576 | ("element", InternalTraversal.dp_clauseelement) |
| 3577 | ] |
| 3578 | |
| 3579 | element: ColumnElement[_T] |
| 3580 | |
| 3581 | def __init__(self, element: ColumnElement[_T]): |
| 3582 | self.element = element |
| 3583 | |
| 3584 | @util.ro_non_memoized_property |
| 3585 | def _from_objects(self) -> List[FromClause]: |
| 3586 | return [] |
| 3587 | |
| 3588 | |
| 3589 | class _textual_label_reference(ColumnElement[Any]): |