simonw / sqlite-utils

Python CLI utility and library for manipulating SQLite databases
https://sqlite-utils.datasette.io
Apache License 2.0
1.58k stars 106 forks source link

pyright and mypy showing access error messages for basic sqlite-utils usage #607

Closed geekodour closed 7 months ago

geekodour commented 7 months ago

This is not causing any issues in running of my programs but is minor inconvenience, I am not sure what should be the fix. This is pyright on emacs.

image image

This is mypy: image

code:

def ensure_tables(db: Database):
    if "users" not in db.table_names():
        db["users"].create({
            "id": int,
            "username": str,
            "access_token": str,
            "refresh_token": str,
            "expires_in": int,
            "expires_at": int,
            "last_sync": datetime.datetime
        }, pk="id")

Any suggestions on what should be the fix