If AWS lambda doesn't offer any kind of stepwise debugging facility then you would have to keep trying different things, differnet combinations of configuration / imports, and whatever else you can think of that makes the behavior occur or not occur, until you can isolate it to a single thing.
I don't know how AWS lambda works but if you're saying a three line SQLAlchemy program like the one below fails: >>> from sqlalchemy import table, select, column >>> t = table('t', column('a'), column('b')) >>> stmt = select([t]).where(t.c.a == 'hi') >>> print(stmt) SELECT t.a, t.b FROM t WHERE t.a = :a_1 that would mean SQLAlchemy itself is setting itself up in some way that is not compatible with AWS lambda. On Fri, Feb 14, 2020, at 4:32 PM, Mark Wilkins wrote: > 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> >>> 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. >>> > 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. >>> 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 > > <https://groups.google.com/d/msgid/sqlalchemy/5ca02432-e957-412d-91a4-4f4c9dd67f0c%40googlegroups.com?utm_medium=email&utm_source=footer>. -- 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/6d2bdd46-56ed-45a3-bb7a-de1aa8003550%40www.fastmail.com.