-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TYP: fix a few types #54976
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: fix a few types #54976
Changes from all commits
88f93f9
0f72079
4f03cc2
9d9aefc
bb379a5
9b99638
b3a2ada
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1926,11 +1926,17 @@ def to_dict( | |
self, | ||
orient: Literal["dict", "list", "series", "split", "tight", "index"] = ..., | ||
into: type[dict] = ..., | ||
index: bool = ..., | ||
) -> dict: | ||
... | ||
|
||
@overload | ||
def to_dict(self, orient: Literal["records"], into: type[dict] = ...) -> list[dict]: | ||
def to_dict( | ||
self, | ||
orient: Literal["records"], | ||
into: type[dict] = ..., | ||
index: bool = ..., | ||
) -> list[dict]: | ||
... | ||
|
||
@deprecate_nonkeyword_arguments( | ||
|
@@ -11297,7 +11303,7 @@ def _reduce_axis1(self, name: str, func, skipna: bool) -> Series: | |
def any( # type: ignore[override] | ||
self, | ||
*, | ||
axis: Axis = 0, | ||
axis: Axis | None = 0, | ||
bool_only: bool = False, | ||
skipna: bool = True, | ||
**kwargs, | ||
|
@@ -11312,7 +11318,7 @@ def any( # type: ignore[override] | |
@doc(make_doc("all", ndim=2)) | ||
def all( | ||
self, | ||
axis: Axis = 0, | ||
axis: Axis | None = 0, | ||
bool_only: bool = False, | ||
skipna: bool = True, | ||
**kwargs, | ||
|
@@ -11711,6 +11717,7 @@ def quantile( | |
axis: Axis = ..., | ||
numeric_only: bool = ..., | ||
interpolation: QuantileInterpolation = ..., | ||
method: Literal["single", "table"] = ..., | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Present in the implementation but missing in the overloads |
||
) -> Series: | ||
... | ||
|
||
|
@@ -11721,6 +11728,7 @@ def quantile( | |
axis: Axis = ..., | ||
numeric_only: bool = ..., | ||
interpolation: QuantileInterpolation = ..., | ||
method: Literal["single", "table"] = ..., | ||
) -> Series | DataFrame: | ||
... | ||
|
||
|
@@ -11731,6 +11739,7 @@ def quantile( | |
axis: Axis = ..., | ||
numeric_only: bool = ..., | ||
interpolation: QuantileInterpolation = ..., | ||
method: Literal["single", "table"] = ..., | ||
) -> Series | DataFrame: | ||
... | ||
|
||
|
@@ -11830,11 +11839,10 @@ def quantile( | |
|
||
if not is_list_like(q): | ||
# BlockManager.quantile expects listlike, so we wrap and unwrap here | ||
# error: List item 0 has incompatible type "Union[float, Union[Union[ | ||
# ExtensionArray, ndarray[Any, Any]], Index, Series], Sequence[float]]"; | ||
# expected "float" | ||
res_df = self.quantile( # type: ignore[call-overload] | ||
[q], | ||
# error: List item 0 has incompatible type "float | ExtensionArray | | ||
# ndarray[Any, Any] | Index | Series | Sequence[float]"; expected "float" | ||
res_df = self.quantile( | ||
[q], # type: ignore[list-item] | ||
axis=axis, | ||
numeric_only=numeric_only, | ||
interpolation=interpolation, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -941,9 +941,7 @@ def write( | |
if isinstance(writer, ExcelWriter): | ||
need_save = False | ||
else: | ||
# error: Cannot instantiate abstract class 'ExcelWriter' with abstract | ||
# attributes 'engine', 'save', 'supported_extensions' and 'write_cells' | ||
writer = ExcelWriter( # type: ignore[abstract] | ||
writer = ExcelWriter( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Won't this immediately raise in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahh, no, because we overwrite |
||
writer, | ||
engine=engine, | ||
storage_options=storage_options, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Present in the implementation but missing in the overloads