Skip to content

SQLAlchemy typing and drop deprecated mypy plugin #433

Description

@chaen

we currently have #type: ignore comments in places like that:

for _ in range(DeviceFlows.user_code.type.length) # type: ignore

This is because we need to specify the types at the table level

user_code = Column("UserCode", String(USER_CODE_LENGTH), primary_key=True)

Should be changed to something like

user_code: Mapped[str] = mapped_column("UserCode", String(USER_CODE_LENGTH), primary_key=True)

Conversion guide:

https://docs.sqlalchemy.org/en/20/changelog/whatsnew_20.html#new-typing-support-in-core-and-orm-stubs-extensions-no-longer-used

Also the mypy plugin is no longer supported and should be dropped: #438

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions