[0.6.0] can't use sa.func.text(...)
Issue #1798
resolved
I have a non-TEXT column I would like converted to TEXT. In PostgreSQL I would normally do either this:
SELECT foo::text from table;
or
SELECT text(foo) from table;
When I tried to do this with the 'func' functionality, I get an error:
column = sa.func.text(table.c[key](key))
File "/usr/lib64/python2.6/site-packages/sqlalchemy/sql/expression.py", line 859, in __call__
return func(*c, **o)
File "/usr/lib64/python2.6/site-packages/sqlalchemy/sql/expression.py", line 820, in text
return _TextClause(text, bind=bind, *args, **kwargs)
File "/usr/lib64/python2.6/site-packages/sqlalchemy/sql/expression.py", line 2348, in __init__
self.text = self._bind_params_regex.sub(repl, text)
TypeError: expected string or buffer
----------------------------------------
However, as a test, I tried sa.func.date and others, and they all work. Am I crazy thinking that this should work?
Comments (3)
-
repo owner -
repo owner - changed status to resolved
-
repo owner - removed milestone
Removing milestone: 0.6.1 (automated comment)
- Log in to comment
this is a bug. here's a patch that will be committed soon: