Type imports or stubs for mypy


I’ve recently join a team that already has everything working about GX, except the mypy integration. To be upfront, I’m quite new to mypy, but I want to fix the problem. The team is currently on GX 0.17.14:

$ poetry run great_expectations --version
great_expectations, version 0.17.14

We will update to 0.17.15 soon. Right now, they have ignored GX in mypy configuration:

module = "great_expectations.*"
ignore_missing_imports = true

But if I remove those settings, I still get those mypy errors (I’ll only show one):

src/my/path/file.py:4: error: Skipping analyzing "great_expectations": module is installed, but missing library stubs or py.typed marker  [import]

When I look at the project, I see that the project itself uses mypy to check types for all contributions. So my question is: Is the project PEP561 compliant? If so, how do we import the types or the stubs needed for our mypy to work? Did we miss something?

I’m available to answer more questions about our set up if needed.

Hey @Thagor ! Thanks for raising this.

This is an area of ongoing work for us. It’s our goal to eventually be fully typed & compliant, and new code is typically introduced with appropriate types. We’re currently working through the older parts of the codebase and hope to be PEP561 compliant in the near future!

1 Like