@@ -2823,14 +2823,11 @@ def __init__(self, expression, type_):
28232823 renders SQL that labels the expression, but otherwise does not
28242824 modify its value on the SQL side::
28252825
2826- SELECT date_string AS anon_1 FROM log
2826+ SELECT date_string AS date_string FROM log
28272827
2828- When result rows are fetched, the ``StringDateTime`` type
2828+ When result rows are fetched, the ``StringDateTime`` type processor
28292829 will be applied to result rows on behalf of the ``date_string`` column.
2830- The rationale for the "anon_1" label is so that the type-coerced
2831- column remains separate in the list of result columns vs. other
2832- type-coerced or direct values of the target column. In order to
2833- provide a named label for the expression, use
2830+ In order to provide a named label for the expression, use
28342831 :meth:`_expression.ColumnElement.label`::
28352832
28362833 stmt = select([
@@ -2893,6 +2890,13 @@ def typed_expression(self):
28932890 def wrapped_column_expression (self ):
28942891 return self .clause
28952892
2893+ def self_group (self , against = None ):
2894+ grouped = self .clause .self_group (against = against )
2895+ if grouped is not self .clause :
2896+ return TypeCoerce (grouped , self .type )
2897+ else :
2898+ return self
2899+
28962900
28972901class Extract (ColumnElement ):
28982902 """Represent a SQL EXTRACT clause, ``extract(field FROM expr)``."""
0 commit comments