Skip to content

No type checks are done in CI & lance-ray has a bunch of type error when using mypy --strict #65

@jonded94

Description

@jonded94

lance-ray is missing a py.typed marker file which I introduce here, but more importantly, there seem to be a bunch of type errors in general.

This is the output of mypy:

$ mypy --strict lance_ray tests
[...]
Found 194 errors in 11 files (checked 13 source files)

Many of these are because corresponding type stubs packages such as pandas-stubs, pyarrow-stubs, and co. are not installed, similar to errors such as error: Skipping analyzing "lance": module is installed, but missing library stubs or py.typed marker because lance was missing the py.typed marker too. But there are also other issues with internal type unsoundness. I would see it personally as quite important for a library to be ideally error free under mypy --strict nowadays, both to enable safer internal refactoring, but also to provide sound interfaces for external users.

I'd propose following actions:

  • introduce mypy --strict as a CI job
  • install all available stubs packages such as pandas-stubs, pyarrow-stubs as a dev dependency
  • start with a type error ignore list in pyproject.toml that gradually would decrease in size
    • for lance, it unfortunately was done the other way around, with type checking as an opt-in, which in turn means any new file will be unchecked by default

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