Skip to content

Commit 0baffcd

Browse files
GH1037 Remove na_sentinel from factorize methods
1 parent 779aab6 commit 0baffcd

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pandas-stubs/core/arrays/base.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ class ExtensionArray:
4242
def shift(self, periods: int = ..., fill_value: object = ...) -> Self: ...
4343
def unique(self): ...
4444
def searchsorted(self, value, side: str = ..., sorter=...): ...
45-
# TODO: remove keyword-only when pandas removed na_sentinel
46-
def factorize(self, *, use_na_sentinel: bool = ...) -> tuple[np.ndarray, Self]: ...
45+
def factorize(
46+
self, sort: bool = ..., use_na_sentinel: bool = ...
47+
) -> tuple[np.ndarray, Self]: ...
4748
def repeat(self, repeats, axis=...): ...
4849
def take(
4950
self,

tests/test_pandas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ def test_lreshape() -> None:
790790

791791

792792
def test_factorize() -> None:
793-
codes, uniques = pd.factorize(np.array(["b", "b", "a", "c", "b"]))
793+
codes, uniques = pd.factorize(np.array(["b", "b", "a", "c", "b"]), sort=False)
794794
check(assert_type(codes, np.ndarray), np.ndarray)
795795
check(assert_type(uniques, np.ndarray), np.ndarray)
796796

0 commit comments

Comments
 (0)