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 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 occur, that is suddenly not the case, or the Visitable / > BinaryExpression symbol has been modified at runtime, something like > that. It's not clear if this could be some artifact of AWS Lambda, or > the way the application is doing imports, or something like that. > > the approach here would be to make a test program that produces the error > under AWS Lambda, then run it in a local Python environment and see if the > results are the same or different. > > On Fri, Feb 14, 2020, at 5:16 AM, Simon King wrote: > > 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 <cont...@markwilkins.dev > <javascript:>> wrote: > > > > Some additional code incase its relevent: > > > > # Get DB connection > > engine = setup_env_db_engine(debug=True) > > connection = engine.connect() > > > > # Configure SQLalchemy > > meta = MetaData(bind=engine) > > meta.reflect() > > > > my_table = meta.tables.get('my_table') > > > > > > -- > > SQLAlchemy - > > The Python SQL Toolkit and Object Relational Mapper > > > > http://www.sqlalchemy.org/ > > > > To post example code, please provide an MCVE: Minimal, Complete, and > Verifiable Example. See http://stackoverflow.com/help/mcve for a full > description. > > --- > > 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 sqlal...@googlegroups.com <javascript:>. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/sqlalchemy/839938dd-ed33-4f55-a836-185ec0689f2f%40googlegroups.com > . > > -- > SQLAlchemy - > The Python SQL Toolkit and Object Relational Mapper > > http://www.sqlalchemy.org/ > > To post example code, please provide an MCVE: Minimal, Complete, and > Verifiable Example. See http://stackoverflow.com/help/mcve for a full > description. > --- > 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 sqlal...@googlegroups.com <javascript:>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sqlalchemy/CAFHwexfyHn5OKiAm8k9QX3R3Gm4xAoZRy7%3Dg33L%3DdO%3DvSDumZg%40mail.gmail.com > . > > > -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- 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 view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/5ca02432-e957-412d-91a4-4f4c9dd67f0c%40googlegroups.com.