Re: [sqlalchemy] Re: SQL expression object expected, got object of type instead

2020-02-14 Thread Mark Wilkins
This seems to be correct, the issue does not occur if I run the exact same code locally. Lambda must be doing something, somehow, that is causing this. Any advice on how to fix the problem? On Friday, February 14, 2020 at 9:10:49 AM UTC-5, Mike Bayer wrote: > > this looks like something up

Re: [sqlalchemy] Re: SQL expression object expected, got object of type instead

2020-02-14 Thread Mark Wilkins
This is the actual code, with table names swapped out. I've confirmed that my_table.c.name is infact a column, and the comparison operation generates a BinaryExpression object as it is supposed to. The issue is that where() throws an exception indicating it doesn't accept BinaryExpression

Re: [sqlalchemy] how to "explicitly" combine columns, for example get the child class value from a query on parent class from same named column?

2020-02-14 Thread Mark Aquino
There's no point in really having the visible_id on the A table, other than for inheritance. The point of it being on B (and C, D, E, F, etc.) is that they have unique sequences populating those "Visible IDs", so I have can have a B-1 and a C-1 and a D-1. In other words I have my parent table

Re: [sqlalchemy] how to "explicitly" combine columns, for example get the child class value from a query on parent class from same named column?

2020-02-14 Thread Mark Aquino
There's no point in really having the visible_id on the A table, other than for inheritance. The point of it being on B (and C, D, E, F, etc.) is that they have unique sequences populating those "Visible IDs", so I have can have a B-1 and a C-1 and a D-1. In other words I have my parent table

Re: [sqlalchemy] how to "explicitly" combine columns, for example get the child class value from a query on parent class from same named column?

2020-02-14 Thread Simon King
On Fri, Feb 14, 2020 at 5:35 PM Mark Aquino wrote: > > I have a polymorphic class structure like this, with a lot of classes > extending the parent class. > In reality I'm using a Mixin that declares the visible_id column and it's > defined with @declared_attr.cascading, but for simplicity: > >

[sqlalchemy] how to "explicitly" combine columns, for example get the child class value from a query on parent class from same named column?

2020-02-14 Thread Mark Aquino
I have a polymorphic class structure like this, with a lot of classes extending the parent class. In reality I'm using a Mixin that declares the visible_id column and it's defined with @declared_attr.cascading, but for simplicity: class A(Base): __tablename__ = 'a' id =

Re: [sqlalchemy] Re: SQL expression object expected, got object of type instead

2020-02-14 Thread Mike Bayer
this looks like something up with the environment or the interpreter. The error message says it got an object whose type() returns "BinaryExpression". that is exactly the type it is looking for; this class should be a subclass of sqlalchemy.sql.visitors.Visitable. However for this error to

Re: [sqlalchemy] Re: SQL expression object expected, got object of type instead

2020-02-14 Thread Simon King
Can you show the real code that runs the query? I'm wondering whether the thing that you are comparing against my_table.c.name is not actually a simple string. Simon On Wed, Feb 12, 2020 at 11:01 PM Mark Wilkins wrote: > > Some additional code incase its relevent: > > # Get DB connection >