Skip to content

Conversation

MarcoGorelli
Copy link
Member

  • Closes #xxxx (Replace xxxx with the Github issue number)
  • Tests added: Please use assert_type() to assert the type of any return value

@MarcoGorelli MarcoGorelli marked this pull request as ready for review October 13, 2025 18:28
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: ...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sequence[int] now missing

Comment on lines 11 to 29
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)
Copy link
Contributor

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.

Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants