Skip to content

mypy's "has no attribute" error #579

Open
@conservative-dude

Description

@conservative-dude

Hi,

Databases return Record class instance, and we can get column values by simply specifying column name

record = db.fetch_one(query=query, values=values)
print(record.id)

mypy gives the following error: Mypy: "Record" has no attribute "id" [attr-defined]

Is there a way to set up mypy to work correctly with this use case?

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