Skip to content

TYP: check typings with pyright #44254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 2, 2021
Merged

TYP: check typings with pyright #44254

merged 1 commit into from
Nov 2, 2021

Conversation

twoertwein
Copy link
Member

small followup to #44233

@simonjayhawkins
Copy link
Member

Thanks @twoertwein

Any changes needed for the pre-commit check?

@simonjayhawkins simonjayhawkins added the Typing type annotations, mypy/pyright type checking label Nov 1, 2021
@simonjayhawkins simonjayhawkins added this to the 1.4 milestone Nov 1, 2021
@twoertwein
Copy link
Member Author

Do you think it makes sense to replace

numba = import_optional_dependency("numa")

with

import_optional_dependency("numa")
import numba

Unfortunately, I didn't find a way to type import_optional_dependency (even with overloads, a module by itself is no type).

Any changes needed for the pre-commit check?

No, pre-commit just calls pyright same as for the CI.

@simonjayhawkins
Copy link
Member

I have a PR whch i'm just running the tests etc for before opening in which I use

    if TYPE_CHECKING:
        import numba
    else:
        numba = import_optional_dependency("numba")

@simonjayhawkins simonjayhawkins merged commit ca61bec into pandas-dev:master Nov 2, 2021
@simonjayhawkins
Copy link
Member

Thanks @twoertwein

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants