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 @@ -27,9 +27,9 @@ Bug fixes
27
27
- Fixed bug in :meth: `DataFrame.interpolate ` raising incorrect error message (:issue: `55347 `)
28
28
- Fixed bug in :meth: `Index.insert ` raising when inserting ``None `` into :class: `Index ` with ``dtype="string[pyarrow_numpy]" `` (:issue: `55365 `)
29
29
- Fixed bug in :meth: `Series.all ` and :meth: `Series.any ` not treating missing values correctly for ``dtype="string[pyarrow_numpy]" `` (:issue: `55367 `)
30
+ - Fixed bug in :meth: `Series.floordiv ` for :class: `ArrowDtype ` (:issue: `55561 `)
30
31
- Fixed bug in :meth: `Series.rank ` for ``string[pyarrow_numpy] `` dtype (:issue: `55362 `)
31
32
- Silence ``Period[B] `` warnings introduced by :issue: `53446 ` during normal plotting activity (:issue: `55138 `)
32
- -
33
33
34
34
.. ---------------------------------------------------------------------------
35
35
.. _whatsnew_212.other :
Original file line number Diff line number Diff line change @@ -116,7 +116,8 @@ def floordiv_compat(
116
116
) -> pa .ChunkedArray :
117
117
# Ensure int // int -> int mirroring Python/Numpy behavior
118
118
# as pc.floor(pc.divide_checked(int, int)) -> float
119
- result = pc .floor (pc .divide (left , right ))
119
+ converted_left = cast_for_truediv (left , right )
120
+ result = pc .floor (pc .divide (converted_left , right ))
120
121
if pa .types .is_integer (left .type ) and pa .types .is_integer (right .type ):
121
122
result = result .cast (left .type )
122
123
return result
Original file line number Diff line number Diff line change @@ -3091,3 +3091,12 @@ def test_factorize_chunked_dictionary():
3091
3091
exp_uniques = pd .Index (ArrowExtensionArray (pa_array .combine_chunks ()))
3092
3092
tm .assert_numpy_array_equal (res_indices , exp_indicies )
3093
3093
tm .assert_index_equal (res_uniques , exp_uniques )
3094
+
3095
+
3096
+ def test_arrow_floordiv ():
3097
+ # GH 55561
3098
+ a = pd .Series ([- 7 ], dtype = "int64[pyarrow]" )
3099
+ b = pd .Series ([4 ], dtype = "int64[pyarrow]" )
3100
+ expected = pd .Series ([- 2 ], dtype = "int64[pyarrow]" )
3101
+ result = a // b
3102
+ tm .assert_series_equal (result , expected )
You can’t perform that action at this time.
0 commit comments