else:
return False
+ def cast(self, type_):
+ """Produce a type cast, i.e. ``CAST(<expression> AS <type>)``.
+
+ This is a shortcut to the :func:`.cast` function.
+ """
+ return Cast(self, type_)
+
def label(self, name):
"""Produce a column label, i.e. ``<columnname> AS <name>``.
"SELECT CAST(test_table.y AS VARCHAR) AS anon_1 FROM test_table"
)
+ def test_cast_method(self):
+ table = self._fixture()
+ self.assert_compile(
+ select([table.c.y.cast(String)]),
+ "SELECT CAST(test_table.y AS VARCHAR) AS anon_1 FROM test_table"
+ )
+
def test_select_cols_use_labels(self):
table = self._fixture()