-
-
Notifications
You must be signed in to change notification settings - Fork 150
Type ExtensionArray.{dropna,unique,repeat,take,ravel}
#1423
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
base: main
Are you sure you want to change the base?
Conversation
4d3884a
to
a003040
Compare
def searchsorted(self, value, side: str = ..., sorter=...): ... | ||
def factorize(self, use_na_sentinel: bool = True) -> tuple[np_1darray, Self]: ... | ||
def repeat(self, repeats, axis=...): ... | ||
def repeat(self, repeats: int | AnyArrayLikeInt, axis: None = None) -> Self: ... |
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.
Sequence[int]
now missing
def test_ea_common() -> None: | ||
arr = array([1, 2, 3]) | ||
|
||
check(assert_type(arr.repeat(1), IntegerArray), IntegerArray) | ||
check(assert_type(arr.repeat(arr), IntegerArray), IntegerArray) | ||
check( | ||
assert_type(arr.repeat(repeats=pd.Series([1, 2, 3])), IntegerArray), | ||
IntegerArray, | ||
) | ||
check(assert_type(arr.repeat(pd.Index([1, 2, 3])), IntegerArray), IntegerArray) | ||
|
||
check(assert_type(arr.unique(), IntegerArray), IntegerArray) | ||
check(assert_type(arr.dropna(), IntegerArray), IntegerArray) | ||
check(assert_type(arr.take([1, 0, 2]), IntegerArray), IntegerArray) | ||
check( | ||
assert_type(arr.take([1, 0, 2], allow_fill=True, fill_value=-1), IntegerArray), | ||
IntegerArray, | ||
) | ||
check(assert_type(arr.ravel(), IntegerArray), IntegerArray) |
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.
You are actually testing IntegerArray
. ExtensionArray
is abstract, anyway.
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.
sure, thanks, i've added a comment about that
assert_type()
to assert the type of any return value