Skip to content
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

TYP: Update timestamps.pyi #47756

Merged
merged 5 commits into from
Jul 17, 2022
Merged

TYP: Update timestamps.pyi #47756

merged 5 commits into from
Jul 17, 2022

Conversation

hauntsaninja
Copy link
Contributor

No description provided.

@twoertwein
Copy link
Member

Thanks @hauntsaninja! I assume you use the not-yet-released mypy 0.970? When I run python -m mypy.stubtest pandas --ignore-missing-stub --concise --mypy-config-file pyproject.toml

I only get

error: not checking stubs due to mypy build errors:
pandas/core/indexes/base.py:7138: error: Cannot determine type of "argmin"  [has-type]
pandas/core/indexes/base.py:7150: error: Cannot determine type of "argmax"  [has-type]
pandas/core/window/rolling.py:1842: error: Unused "type: ignore" comment
pandas/core/window/rolling.py:1848: error: Unused "type: ignore" comment

Seems there are some type errors:
https://github.com/pandas-dev/pandas/runs/7373010497?check_suite_focus=true

@hauntsaninja
Copy link
Contributor Author

hauntsaninja commented Jul 16, 2022

I used mypy==0.960 for this, but did a couple unconventional things to get things running :-) I'll file an issue for running stubtest in CI and help get it integrated properly.

Btw, what is the relationship between the stubs in pandas-dev/pandas.git and the stubs in pandas-dev/pandas-stubs.git?

@twoertwein
Copy link
Member

Btw, what is the relationship between the stubs in pandas-dev/pandas.git and the stubs in pandas-dev/pandas-stubs.git?

Ideally, they should be the same (and I hope that in the future they are the same). In many cases, pandas and pandas-stubs are/will hopefully be aligned but in certain cases, it is impossible(?) to find a "good" annotation. For pandas-stubs, "good" roughly means it works for users. For pandas, "good" roughly means what is technically possible (e.g., pd.Timestamp(float("NaN")) returns NaTType or another difficult case is __getitem__ #46616).

@twoertwein twoertwein added the Typing type annotations, mypy/pyright type checking label Jul 16, 2022
@twoertwein twoertwein merged commit bdd9314 into pandas-dev:main Jul 17, 2022
@twoertwein
Copy link
Member

Thank you @hauntsaninja!

@hauntsaninja hauntsaninja deleted the timestamp branch July 17, 2022 14:57
@twoertwein twoertwein added this to the 1.5 milestone Jul 18, 2022
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.

2 participants