Skip to content

MyPy defaults to ANY if the import path is bad #49309

Open
@ferruzzi

Description

@ferruzzi

Body

If you have an import in an if TYPE_CHECKING, mypy may decide to treat it as type(ANY) if it has a problem.

To reproduce:

If you look in pyproject.toml you can see (currently on L930, but that may change)

[tool.mypy]
ignore_missing_imports = true

If you swap that to false and run mypy you'll find over a thousand new errors that should be fixed.

Task:

These can be broken into small bites and fixed in batches, but they should be done and then flip that option to false in pyproject.toml to prevent regression.

For some more context and discussion, see the slack thread here.

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.

Metadata

Metadata

Assignees

Labels

area:dev-envCI, pre-commit, pylint and other changes that do not change the behavior of the final codemypyFixing MyPy problems after bumpin MyPy to 0.990

Type

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions