File tree 3 files changed +12
-2
lines changed
3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -29,9 +29,9 @@ Bug fixes
29
29
- Fixed bug in :meth: `DataFrame.interpolate ` raising incorrect error message (:issue: `55347 `)
30
30
- Fixed bug in :meth: `Index.insert ` raising when inserting ``None `` into :class: `Index ` with ``dtype="string[pyarrow_numpy]" `` (:issue: `55365 `)
31
31
- Fixed bug in :meth: `Series.all ` and :meth: `Series.any ` not treating missing values correctly for ``dtype="string[pyarrow_numpy]" `` (:issue: `55367 `)
32
+ - Fixed bug in :meth: `Series.floordiv ` for :class: `ArrowDtype ` (:issue: `55561 `)
32
33
- Fixed bug in :meth: `Series.rank ` for ``string[pyarrow_numpy] `` dtype (:issue: `55362 `)
33
34
- Silence ``Period[B] `` warnings introduced by :issue: `53446 ` during normal plotting activity (:issue: `55138 `)
34
- -
35
35
36
36
.. ---------------------------------------------------------------------------
37
37
.. _whatsnew_212.other :
Original file line number Diff line number Diff line change @@ -119,7 +119,8 @@ def floordiv_compat(
119
119
) -> pa .ChunkedArray :
120
120
# Ensure int // int -> int mirroring Python/Numpy behavior
121
121
# as pc.floor(pc.divide_checked(int, int)) -> float
122
- result = pc .floor (pc .divide (left , right ))
122
+ converted_left = cast_for_truediv (left , right )
123
+ result = pc .floor (pc .divide (converted_left , right ))
123
124
if pa .types .is_integer (left .type ) and pa .types .is_integer (right .type ):
124
125
result = result .cast (left .type )
125
126
return result
Original file line number Diff line number Diff line change @@ -3046,3 +3046,12 @@ def test_factorize_chunked_dictionary():
3046
3046
exp_uniques = pd .Index (ArrowExtensionArray (pa_array .combine_chunks ()))
3047
3047
tm .assert_numpy_array_equal (res_indices , exp_indicies )
3048
3048
tm .assert_index_equal (res_uniques , exp_uniques )
3049
+
3050
+
3051
+ def test_arrow_floordiv ():
3052
+ # GH 55561
3053
+ a = pd .Series ([- 7 ], dtype = "int64[pyarrow]" )
3054
+ b = pd .Series ([4 ], dtype = "int64[pyarrow]" )
3055
+ expected = pd .Series ([- 2 ], dtype = "int64[pyarrow]" )
3056
+ result = a // b
3057
+ tm .assert_series_equal (result , expected )
You can’t perform that action at this time.
0 commit comments