@@ -278,7 +278,13 @@ def test_map(self, data_missing, na_action):
278
278
expected = data_missing .to_numpy (dtype = object )
279
279
tm .assert_numpy_array_equal (result , expected )
280
280
else :
281
- super ().test_map (data_missing , na_action )
281
+ result = data_missing .map (lambda x : x , na_action = na_action )
282
+ if data_missing .dtype == "float32[pyarrow]" :
283
+ # map roundtrips through objects, which converts to float64
284
+ expected = data_missing .to_numpy (dtype = "float64" , na_value = np .nan )
285
+ else :
286
+ expected = data_missing .to_numpy ()
287
+ tm .assert_numpy_array_equal (result , expected )
282
288
283
289
def test_astype_str (self , data , request ):
284
290
pa_dtype = data .dtype .pyarrow_dtype
@@ -1585,7 +1591,7 @@ def test_to_numpy_with_defaults(data):
1585
1591
else :
1586
1592
expected = np .array (data ._pa_array )
1587
1593
1588
- if data ._hasna :
1594
+ if data ._hasna and not is_numeric_dtype ( data . dtype ) :
1589
1595
expected = expected .astype (object )
1590
1596
expected [pd .isna (data )] = pd .NA
1591
1597
@@ -1597,8 +1603,8 @@ def test_to_numpy_int_with_na():
1597
1603
data = [1 , None ]
1598
1604
arr = pd .array (data , dtype = "int64[pyarrow]" )
1599
1605
result = arr .to_numpy ()
1600
- expected = np .array ([1 , pd . NA ], dtype = object )
1601
- assert isinstance (result [0 ], int )
1606
+ expected = np .array ([1 , np . nan ] )
1607
+ assert isinstance (result [0 ], float )
1602
1608
tm .assert_numpy_array_equal (result , expected )
1603
1609
1604
1610
0 commit comments