Skip to content

Python postgres connector #13595

@bocodigital

Description

@bocodigital

The Postgres connector's lambda-to-SQL flow builds predicate strings but then inserts them into queries in a way that treats them as SQL literals (quoted strings) rather than expressions. This results in queries like WHERE '"content_type" = 'course'' which Postgres rejects as an invalid boolean. The fix is to pass parsed clauses into psycopg.sql as sql.SQL(...)/sql.Composed objects (or better: return parameterized clauses + params). I'm attaching a small patch that converts where_clauses to sql.SQL before formatting; I'd be happy to open a PR that returns parameterized clauses and params for safer construction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpythonPull requests for the Python Semantic Kerneltriage

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions