@@ -278,7 +278,13 @@ def test_map(self, data_missing, na_action):
278278 expected = data_missing .to_numpy (dtype = object )
279279 tm .assert_numpy_array_equal (result , expected )
280280 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 )
282288
283289 def test_astype_str (self , data , request ):
284290 pa_dtype = data .dtype .pyarrow_dtype
@@ -1585,7 +1591,7 @@ def test_to_numpy_with_defaults(data):
15851591 else :
15861592 expected = np .array (data ._pa_array )
15871593
1588- if data ._hasna :
1594+ if data ._hasna and not is_numeric_dtype ( data . dtype ) :
15891595 expected = expected .astype (object )
15901596 expected [pd .isna (data )] = pd .NA
15911597
@@ -1597,8 +1603,8 @@ def test_to_numpy_int_with_na():
15971603 data = [1 , None ]
15981604 arr = pd .array (data , dtype = "int64[pyarrow]" )
15991605 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 )
16021608 tm .assert_numpy_array_equal (result , expected )
16031609
16041610
0 commit comments