Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ jobs:

- name: Run mypy
run:
mypy tests/pandas
mypy tests/pandas typings/pandas

2 changes: 1 addition & 1 deletion pyrighttestconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"typeCheckingMode": "basic",
"include": [ "tests" ],
"include": [ "tests", "typings/pandas" ],
"reportMissingModuleSource": false,
"reportUnusedVariable": false,
"useLibraryCodeForTypes": true,
Expand Down
2 changes: 1 addition & 1 deletion runtests.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
echo on
pytest tests > pytest.out
mypy tests > mypytests.out
mypy tests typings/pandas > mypytests.out
pyright -p pyrighttestconfig.json > pandastests.out

2 changes: 1 addition & 1 deletion runtests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
pytest tests > pytest.out
mypy tests > mypytests.out
mypy tests typings/pandas > mypytests.out
pyright -p pyrighttestconfig.json > pandastests.out

2 changes: 2 additions & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ pyright
pytest
mypy==0.950
typing_extensions==4.2.0
matplotlib>=3.3.2
numpy>=1.22.3
1 change: 1 addition & 0 deletions typings/pandas/_typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ PythonScalar = Union[str, int, float, bool, complex]
DatetimeLikeScalar = TypeVar("DatetimeLikeScalar", Period, Timestamp, Timedelta)
PandasScalar = Union[bytes, datetime.date, datetime.datetime, datetime.timedelta]
# Scalar = Union[PythonScalar, PandasScalar]
IntStrT = TypeVar("IntStrT", int, str)

# dtypes
NpDtype = Union[
Expand Down
19 changes: 19 additions & 0 deletions typings/pandas/core/groupby/base.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#from pandas.core.dtypes.common import is_list_like as is_list_like, is_scalar as is_scalar
from typing import NamedTuple

class OutputKey(NamedTuple):
label: str
position: int

class GroupByMixin: ...

plotting_methods = ...
common_apply_whitelist = ...
series_apply_whitelist = ...
dataframe_apply_whitelist = ...
cythonized_kernels = ...
cython_cast_blacklist = ...
reduction_kernels = ...
transformation_kernels = ...
groupby_other_methods = ...
transform_kernel_whitelist = ...
14 changes: 0 additions & 14 deletions typings/pandas/core/indexes/frozen.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,9 @@ from pandas.core.base import PandasObject as PandasObject
class FrozenList(PandasObject, list):
def union(self, other) -> FrozenList: ...
def difference(self, other) -> FrozenList: ...
__add__ = ...
__iadd__ = ...
def __getitem__(self, n): ...
def __radd__(self, other): ...
def __eq__(self, other) -> bool: ...
__req__ = ...
def __mul__(self, other): ...
__imul__ = ...
def __reduce__(self): ...
def __hash__(self): ...
__setitem__ = ...
__setslice__ = ...
__delitem__ = ...
__delslice__ = ...
pop = ...
append = ...
extend = ...
remove = ...
sort = ...
insert = ...
17 changes: 17 additions & 0 deletions typings/pandas/core/window/common.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from pandas.core.groupby.base import GroupByMixin as GroupByMixin
from typing import Callable, Optional

class WindowGroupByMixin(GroupByMixin):
def __init__(self, obj, *args, **kwargs) -> None: ...

def calculate_center_offset(window): ...
def calculate_min_periods(
window: int,
min_periods: Optional[int],
num_values: int,
required_min_periods: int,
floor: int,
) -> int: ...
def zsqrt(x): ...
def prep_binary(arg1, arg2): ...
def get_weighted_roll_func(cfunc: Callable) -> Callable: ...
54 changes: 0 additions & 54 deletions typings/pandas/io/excel/_base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,60 +13,6 @@ from typing import (
overload,
)

@overload
def read_excel(
filepath: str,
sheet_name: Optional[List[str]],
header: Optional[Union[int, Sequence[int]]] = ...,
names: Optional[Sequence[str]] = ...,
index_col: Optional[Union[int, Sequence[int]]] = ...,
usecols: Optional[Union[int, str, Sequence[Union[int, str, Callable]]]] = ...,
squeeze: bool = ...,
dtype: Union[str, Dict[str, Any], Dtype] = ...,
engine: Optional[str] = ...,
converters: Optional[Dict[Union[int, str], Callable]] = ...,
true_values: Optional[Sequence[Scalar]] = ...,
false_values: Optional[Sequence[Scalar]] = ...,
skiprows: Optional[Union[Sequence[int], int, Callable]] = ...,
nrows: Optional[int] = ...,
na_values=...,
keep_default_na: bool = ...,
verbose: bool = ...,
parse_dates: Union[bool, Sequence, Dict[str, Sequence]] = ...,
date_parser: Optional[Callable] = ...,
thousands: Optional[str] = ...,
comment: Optional[str] = ...,
skipfooter: int = ...,
convert_float: bool = ...,
mangle_dupe_cols: bool = ...,
) -> Dict[str, DataFrame]: ...
@overload
def read_excel(
filepath: str,
sheet_name: List[int],
header: Optional[Union[int, Sequence[int]]] = ...,
names: Optional[Sequence[str]] = ...,
index_col: Optional[Union[int, Sequence[int]]] = ...,
usecols: Optional[Union[int, str, Sequence[Union[int, str, Callable]]]] = ...,
squeeze: bool = ...,
dtype: Union[str, Dict[str, Any], Dtype] = ...,
engine: Optional[str] = ...,
converters: Optional[Dict[Union[int, str], Callable]] = ...,
true_values: Optional[Sequence[Scalar]] = ...,
false_values: Optional[Sequence[Scalar]] = ...,
skiprows: Optional[Union[Sequence[int], int, Callable]] = ...,
nrows: Optional[int] = ...,
na_values=...,
keep_default_na: bool = ...,
verbose: bool = ...,
parse_dates: Union[bool, Sequence, Dict[str, Sequence]] = ...,
date_parser: Optional[Callable] = ...,
thousands: Optional[str] = ...,
comment: Optional[str] = ...,
skipfooter: int = ...,
convert_float: bool = ...,
mangle_dupe_cols: bool = ...,
) -> Dict[int, DataFrame]: ...
@overload
def read_excel(
filepath: str,
Expand Down