Skip to content

Psycopg2 SQL.join false positive #10715

@fivepapertigers

Description

@fivepapertigers

The following produces sql.py:4: error: Argument 1 to "join" of "SQL" has incompatible type "list[Composable]"; expected "SupportsIter[Composable]" [arg-type]

from psycopg2.sql import SQL, Identifier


SQL(" ").join([SQL("SELECT * FROM"), Identifier("table")])

Just started happening and this seems related: #10630 (comment)

Full example: https://github.com/fivepapertigers/psycopg2-mypy-issue/tree/main

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: regressionSomething that worked before doesn't work anymorestubs: false positiveType checkers report false errors

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions