-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: remove usage of _constructor._get_axis_number (fix when _constructor properties return callables) #46018
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
Changes from 3 commits
57b4418
babbeca
800e321
57ab39c
01be021
675c65d
165b762
fe87bbc
af63c87
d951752
5b924fc
43b2940
a8129a2
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
from collections import abc | ||
from typing import ( | ||
TYPE_CHECKING, | ||
Callable, | ||
Hashable, | ||
Iterable, | ||
Literal, | ||
|
@@ -467,7 +468,9 @@ def __init__( | |
|
||
# Standardize axis parameter to int | ||
if isinstance(sample, ABCSeries): | ||
axis = sample._constructor_expanddim._get_axis_number(axis) | ||
from pandas import DataFrame | ||
|
||
axis = DataFrame._get_axis_number(axis) | ||
else: | ||
axis = sample._get_axis_number(axis) | ||
|
||
|
@@ -539,7 +542,7 @@ def __init__( | |
self.new_axes = self._get_new_axes() | ||
|
||
def get_result(self): | ||
cons: type[DataFrame | Series] | ||
cons: Callable | ||
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. could annotate as Callable returning DataFrame|Series 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. 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. Ah, but I probably have to update the actual properties' annotation to callable as well |
||
sample: DataFrame | Series | ||
|
||
# series only | ||
|
Uh oh!
There was an error while loading. Please reload this page.