Skip to content

"Select" has no attribute filter_by #254

@nik123

Description

@nik123

I tried to add sqlalchemy-stubs into my project and I experience problems with following construct:

db.execute(select(User).filter_by(id=user_id))

mypy error is:

error: "Select" has no attribute "filter_by"  [attr-defined]

I've looked into sqlalchemy code and Select construct clearly has filter_by method.

I use Python 3.9.5 with sqlalchemy==1.4.41, mypy==0.990 and sqlalchemy-stubs==0.4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions