I have a sqlalchemy query using a subquery listed below:

test = model.session.query(func.max(SomeEntity.start_time), 
> SomeEntity.name).filter(Run.name.in_(['some 
> name'])).group_by(SomeEntity.name).with_labels().subquery(name = 'sub')
> SomeEntity.query().join(test, 
> SomeEntity.start_time==test.c.max_1).filter(some criteria).all()
>

Executing the above gives me the error below.
 

> ERROR: An unexpected error occurred while tokenizing input
> The following traceback may be corrupted or invalid
> The error message is: ('EOF in multi-line statement', (211, 0))
>
---------------------------------------------------------------------------
> AttributeError                            Traceback (most recent call last)
>
> /home/anthony_le/Repository/projects/hermes/<ipython console> in <module>()
>
> /home/anthony_le/.virtualenvs/hermes-2/local/lib/python2.7/site-packages/sqlalchemy/util/_collections.pyc
>  
> in __getattr__(self, key)
>     170             return self._data[key]
>     171         except KeyError:
> --> 172             raise AttributeError(key)
>     173 
>     174     def __contains__(self, key):
>
> AttributeError: max_1
>
 
I don't understand why I am getting this error. And because I don't 
understand the error, I can't come up with a solution. Can anyone help?

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to