When running the TraP test suite on the branch Issue579, this error arose:
======================================================================
ERROR: test_store_varmetric (test_alchemy.TestApi)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/antoniar/TraP_Develop/tkp/tests/test_database/test_alchemy.py", line 125, in test_store_varmetric
q = tkp.db.alchemy.varmetric.store_varmetric(self.session, self.dataset1)
File "/home/antoniar/TraP_Develop/tkp/tkp/db/alchemy/varmetric.py", line 217, in store_varmetric
filtered = session.query(*fields).select_from(subquery)
File "/home/antoniar/TraP_Develop_Env/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2106, in query
return self._query_cls(entities, self, **kwargs)
File "/home/antoniar/TraP_Develop_Env/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 180, in __init__
self._set_entities(entities)
File "/home/antoniar/TraP_Develop_Env/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 194, in _set_entities
for ent in util.to_list(entities)
File "/home/antoniar/TraP_Develop_Env/local/lib/python2.7/site-packages/sqlalchemy/sql/coercions.py", line 188, in expect
element, argname=argname, **kw
File "/home/antoniar/TraP_Develop_Env/local/lib/python2.7/site-packages/sqlalchemy/sql/coercions.py", line 388, in _literal_coercion
return self._text_coercion(element, argname, **kw)
File "/home/antoniar/TraP_Develop_Env/local/lib/python2.7/site-packages/sqlalchemy/sql/coercions.py", line 834, in _text_coercion
else "column",
ArgumentError: Textual column expression 'runcat' should be explicitly declared with text('runcat'), or use column('runcat') for more specificity
It is not related to the changes made to resolve Issue579 see Issue579
The issue is with this part of the code and sqlalchemy wants things specifying more explicitly.
When running the TraP test suite on the branch Issue579, this error arose:
It is not related to the changes made to resolve Issue579 see Issue579
The issue is with this part of the code and sqlalchemy wants things specifying more explicitly.
https://github.com/transientskp/tkp/blob/fa65950f6a8891e97880e483e03206a06e5f130e/tkp/db/alchemy/varmetric.py#L210-L217
I think this issue from Stack overflow explains how to fix it... https://stackoverflow.com/questions/54483184/sqlalchemy-warning-textual-column-expression-should-be-explicitly-declared Though I'm not sure if just casting it as text would help or if it needs to be defined in the more complex column format.