Skip to content

TYP/CI: enable more pyright checks #59

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
Jul 1, 2022
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
48 changes: 24 additions & 24 deletions pandas-stubs/_libs/interval.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -87,63 +87,63 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
self: Interval[_OrderableTimesT], y: Timedelta
) -> Interval[_OrderableTimesT]: ...
@overload
def __add__(self: Interval[int], y: int) -> Interval[int]: ...
@overload
def __add__(self: Interval[int], y: float) -> Interval[float]: ...
def __add__(
self: Interval[int], y: _OrderableScalarT
) -> Interval[_OrderableScalarT]: ...
@overload
def __add__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ...
@overload
def __radd__(
self: Interval[_OrderableTimesT], y: Timedelta
) -> Interval[_OrderableTimesT]: ...
@overload
def __radd__(self: Interval[int], y: int) -> Interval[int]: ...
@overload
def __radd__(self: Interval[int], y: float) -> Interval[float]: ...
def __radd__(
self: Interval[int], y: _OrderableScalarT
) -> Interval[_OrderableScalarT]: ...
@overload
def __radd__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ...
@overload
def __sub__(
self: Interval[_OrderableTimesT], y: Timedelta
) -> Interval[_OrderableTimesT]: ...
@overload
def __sub__(self: Interval[int], y: int) -> Interval[int]: ...
@overload
def __sub__(self: Interval[int], y: float) -> Interval[float]: ...
def __sub__(
self: Interval[int], y: _OrderableScalarT
) -> Interval[_OrderableScalarT]: ...
@overload
def __sub__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ...
@overload
def __rsub__(
self: Interval[_OrderableTimesT], y: Timedelta
) -> Interval[_OrderableTimesT]: ...
@overload
def __rsub__(self: Interval[int], y: int) -> Interval[int]: ...
@overload
def __rsub__(self: Interval[int], y: float) -> Interval[float]: ...
def __rsub__(
self: Interval[int], y: _OrderableScalarT
) -> Interval[_OrderableScalarT]: ...
@overload
def __rsub__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ...
@overload
def __mul__(self: Interval[int], y: int) -> Interval[int]: ...
@overload
def __mul__(self: Interval[int], y: float) -> Interval[float]: ...
def __mul__(
self: Interval[int], y: _OrderableScalarT
) -> Interval[_OrderableScalarT]: ...
@overload
def __mul__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ...
@overload
def __rmul__(self: Interval[int], y: int) -> Interval[int]: ...
@overload
def __rmul__(self: Interval[int], y: float) -> Interval[float]: ...
def __rmul__(
self: Interval[int], y: _OrderableScalarT
) -> Interval[_OrderableScalarT]: ...
@overload
def __rmul__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ...
@overload
def __truediv__(self: Interval[int], y: int) -> Interval[int]: ...
@overload
def __truediv__(self: Interval[int], y: float) -> Interval[float]: ...
def __truediv__(
self: Interval[int], y: _OrderableScalarT
) -> Interval[_OrderableScalarT]: ...
@overload
def __truediv__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ...
@overload
def __floordiv__(self: Interval[int], y: int) -> Interval[int]: ...
@overload
def __floordiv__(self: Interval[int], y: float) -> Interval[float]: ...
def __floordiv__(
self: Interval[int], y: _OrderableScalarT
) -> Interval[_OrderableScalarT]: ...
@overload
def __floordiv__(
self: Interval[float], y: Union[int, float]
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/algorithms.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def factorize(
values: Any,
sort: bool = ...,
na_sentinel: int = ...,
size_hint: Union[int, None] = None,
size_hint: Union[int, None] = ...,
) -> Tuple[np.ndarray, Union[np.ndarray, Index]]: ...
def value_counts(
values,
Expand Down
8 changes: 4 additions & 4 deletions pandas-stubs/core/frame.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ class DataFrame(NDFrame, OpsMixin):
**kwargs,
) -> DataFrame: ...
def applymap(
self, func: Callable, na_action: Optional[Literal["ignore"]] = None, **kwargs
self, func: Callable, na_action: Optional[Literal["ignore"]] = ..., **kwargs
) -> DataFrame: ...
def append(
self,
Expand Down Expand Up @@ -993,7 +993,7 @@ class DataFrame(NDFrame, OpsMixin):
method: Union[_str, Literal["pearson", "kendall", "spearman"]] = ...,
min_periods: int = ...,
) -> DataFrame: ...
def cov(self, min_periods: Optional[int] = ..., ddof: int = 1) -> DataFrame: ...
def cov(self, min_periods: Optional[int] = ..., ddof: int = ...) -> DataFrame: ...
def corrwith(
self,
other: Union[DataFrame, Series],
Expand All @@ -1009,7 +1009,7 @@ class DataFrame(NDFrame, OpsMixin):
def count(
self, axis: AxisType = ..., level: None = ..., numeric_only: _bool = ...
) -> Series: ...
def nunique(self, axis: AxisType = ..., dropna=True) -> Series: ...
def nunique(self, axis: AxisType = ..., dropna: bool = ...) -> Series: ...
def idxmax(self, axis: AxisType = ..., skipna: _bool = ...) -> Series: ...
def idxmin(self, axis: AxisType = ..., skipna: _bool = ...) -> Series: ...
@overload
Expand Down Expand Up @@ -1731,7 +1731,7 @@ class DataFrame(NDFrame, OpsMixin):
origin: Union[
Timestamp, Literal["epoch", "start", "start_day", "end", "end_day"]
] = ...,
offset: Optional[Union[Timedelta, _str]] = None,
offset: Optional[Union[Timedelta, _str]] = ...,
) -> Resampler: ...
def rfloordiv(
self,
Expand Down
4 changes: 2 additions & 2 deletions pandas-stubs/core/series.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
self,
left: Union[Scalar, Sequence],
right: Union[Scalar, Sequence],
inclusive: Literal["both", "neither", "left", "right"] = "both",
inclusive: Literal["both", "neither", "left", "right"] = ...,
) -> Series[_bool]: ...
def isna(self) -> Series[_bool]: ...
def isnull(self) -> Series[_bool]: ...
Expand Down Expand Up @@ -997,7 +997,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
origin: Union[
Timestamp, Literal["epoch", "start", "start_day", "end", "end_day"]
] = ...,
offset: Optional[Union[Timedelta, _str]] = None,
offset: Optional[Union[Timedelta, _str]] = ...,
) -> Resampler: ...
def first(self, offset) -> Series[S1]: ...
def last(self, offset) -> Series[S1]: ...
Expand Down
14 changes: 7 additions & 7 deletions pandas-stubs/io/json/_normalize.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ def nested_to_record(
) -> Any: ...
def json_normalize(
data: Union[Dict, List[Dict]],
record_path: Optional[Union[str, List]] = None,
meta: Optional[Union[str, List[Union[str, List[str]]]]] = None,
meta_prefix: Optional[str] = None,
record_prefix: Optional[str] = None,
errors: str = "raise",
sep: str = ".",
max_level: Optional[int] = None,
record_path: Optional[Union[str, List]] = ...,
meta: Optional[Union[str, List[Union[str, List[str]]]]] = ...,
meta_prefix: Optional[str] = ...,
record_prefix: Optional[str] = ...,
errors: str = ...,
sep: str = ...,
max_level: Optional[int] = ...,
) -> DataFrame: ...
4 changes: 2 additions & 2 deletions pandas-stubs/plotting/_misc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ from pandas.core.series import Series
def table(
ax,
data,
rowLabels=None,
colLabels=None,
rowLabels=...,
colLabels=...,
): ...
def register() -> None: ...
def deregister() -> None: ...
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,7 @@ typeCheckingMode = "basic"
stubPath = "."
include = ["tests", "pandas-stubs"]
useLibraryCodeForTypes = true
# enable subset of "strict"
reportDuplicateImport = true
reportInvalidStubStatement = true
reportOverlappingOverload = true