Skip to content

Commit

Permalink
DOC: Improve rst file and test case comments for arrow groupby NA fix
Browse files Browse the repository at this point in the history
  • Loading branch information
asharmalik19 committed Jan 31, 2025
1 parent 7f81314 commit 273d85f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions doc/source/whatsnew/v3.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,6 @@ Performance improvements

Bug fixes
~~~~~~~~~
- Fixed bug in :meth:`ArrowExtensionArray.factorize` where NA values were dropped when input was dictionary-encoded even when dropna was set to False(:issue:`60567`)


Categorical
^^^^^^^^^^^
Expand Down Expand Up @@ -782,6 +780,7 @@ ExtensionArray
- Bug in comparison between object with :class:`ArrowDtype` and incompatible-dtyped (e.g. string vs bool) incorrectly raising instead of returning all-``False`` (for ``==``) or all-``True`` (for ``!=``) (:issue:`59505`)
- Bug in constructing pandas data structures when passing into ``dtype`` a string of the type followed by ``[pyarrow]`` while PyArrow is not installed would raise ``NameError`` rather than ``ImportError`` (:issue:`57928`)
- Bug in various :class:`DataFrame` reductions for pyarrow temporal dtypes returning incorrect dtype when result was null (:issue:`59234`)
- Bug in :meth:`ArrowExtensionArray.factorize` where NA values were dropped when input was dictionary-encoded even when dropna was set to False(:issue:`60567`)

Styler
^^^^^^
Expand Down
3 changes: 1 addition & 2 deletions pandas/tests/extension/test_arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3331,11 +3331,10 @@ def test_factorize_chunked_dictionary():


def test_factorize_dictionary_with_na():
# Test that factorize properly handles NA values in dictionary arrays
# GH#60567
arr = pd.array(
["a1", pd.NA], dtype=ArrowDtype(pa.dictionary(pa.int32(), pa.utf8()))
)
# Test with use_na_sentinel=False
indices, uniques = arr.factorize(use_na_sentinel=False)
expected_indices = np.array([0, 1], dtype=np.intp)
expected_uniques = pd.array(["a1", None], dtype=ArrowDtype(pa.string()))
Expand Down

0 comments on commit 273d85f

Please sign in to comment.