-
-
Notifications
You must be signed in to change notification settings - Fork 130
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
Add pandas.api.typing module #1055
Comments
I am unable to reproduce the issue on my end, normally mypy should resolve to go to the pandas and not pandas-stubs. |
@loicdiridollou See https://pandas.pydata.org/pandas-docs/stable/reference/index.html About a 18 months ago, we added |
Okay I am able to reproduce, I was trying to reproduce the issue in the pandas-stubs env, once done in an external dir it is indeed correct. |
@Dr-Irv for context, does that mean doing a similar job to what is in https://github.com/pandas-dev/pandas-stubs/blob/main/pandas-stubs/api/indexers/__init__.pyi where we export the classes? |
Yes, I think this is as simple as copying over the code at https://github.com/pandas-dev/pandas/blob/main/pandas/api/typing/__init__.py, make it a Testing it is another story. I think the tests should be a runtime test that uses each of those types against a runtime object, e.g., from pandas.api.typing import DataFrameGroupBy
def test_typing():
df = pd.DataFrame({"a":[1,2,3]})
check(assert_type(df.groupby("a"), DataFrameGroupBy), DataFrameGroupBy) |
The
pandas.api.typing
module was added in pandas 2.1, but is not present in pandas-stubsTo Reproduce
mypy gives
error: Library stubs not installed for "pandas.api.typing" [import-untyped]
Please complete the following information:
The text was updated successfully, but these errors were encountered: