def type_coerce(expression, type_):
    type_ = type_api.to_instance(type_)

    if hasattr(expression, '__clause_element__'):
        return type_coerce(expression.__clause_element__(), type_)
    elif isinstance(expression, BindParameter):
        bp = expression._clone()
        bp.type = type_
        return bp
    elif not isinstance(expression, Visitable):
        if expression is None:
            return Null()
        else:
            return literal(expression, type_=type_)
    else:
        return Label(None, expression, type_=type_)
Associate a SQL expression with a particular type, without rendering
dataset/ETHPy150Open goFrendiAsgard/kokoropy/kokoropy/packages/sqlalchemy/sql/elements.py/type_coerce