databases icon indicating copy to clipboard operation
databases copied to clipboard

mypy's "has no attribute" error

Open conservative-dude opened this issue 2 years ago • 0 comments

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?

conservative-dude avatar Jan 17 '24 16:01 conservative-dude