@@ -100,7 +100,7 @@ def test_comparison_ops():
100
100
def test_pow_special (value , asarray ):
101
101
if asarray :
102
102
value = np .array ([value ])
103
- result = pd . NA ** value
103
+ result = NA ** value
104
104
105
105
if asarray :
106
106
result = result [0 ]
@@ -117,7 +117,7 @@ def test_pow_special(value, asarray):
117
117
def test_rpow_special (value , asarray ):
118
118
if asarray :
119
119
value = np .array ([value ])
120
- result = value ** pd . NA
120
+ result = value ** NA
121
121
122
122
if asarray :
123
123
result = result [0 ]
@@ -133,7 +133,7 @@ def test_rpow_special(value, asarray):
133
133
def test_rpow_minus_one (value , asarray ):
134
134
if asarray :
135
135
value = np .array ([value ])
136
- result = value ** pd . NA
136
+ result = value ** NA
137
137
138
138
if asarray :
139
139
result = result [0 ]
@@ -197,8 +197,8 @@ def test_arithmetic_ndarray(shape, all_arithmetic_functions):
197
197
a = np .zeros (shape )
198
198
if op .__name__ == "pow" :
199
199
a += 5
200
- result = op (pd . NA , a )
201
- expected = np .full (a .shape , pd . NA , dtype = object )
200
+ result = op (NA , a )
201
+ expected = np .full (a .shape , NA , dtype = object )
202
202
tm .assert_numpy_array_equal (result , expected )
203
203
204
204
@@ -218,50 +218,50 @@ def test_series_isna():
218
218
219
219
220
220
def test_ufunc ():
221
- assert np .log (pd . NA ) is pd . NA
222
- assert np .add (pd . NA , 1 ) is pd . NA
223
- result = np .divmod (pd . NA , 1 )
224
- assert result [0 ] is pd . NA and result [1 ] is pd . NA
221
+ assert np .log (NA ) is NA
222
+ assert np .add (NA , 1 ) is NA
223
+ result = np .divmod (NA , 1 )
224
+ assert result [0 ] is NA and result [1 ] is NA
225
225
226
- result = np .frexp (pd . NA )
227
- assert result [0 ] is pd . NA and result [1 ] is pd . NA
226
+ result = np .frexp (NA )
227
+ assert result [0 ] is NA and result [1 ] is NA
228
228
229
229
230
230
def test_ufunc_raises ():
231
231
msg = "ufunc method 'at'"
232
232
with pytest .raises (ValueError , match = msg ):
233
- np .log .at (pd . NA , 0 )
233
+ np .log .at (NA , 0 )
234
234
235
235
236
236
def test_binary_input_not_dunder ():
237
237
a = np .array ([1 , 2 , 3 ])
238
- expected = np .array ([pd . NA , pd . NA , pd . NA ], dtype = object )
239
- result = np .logaddexp (a , pd . NA )
238
+ expected = np .array ([NA , NA , NA ], dtype = object )
239
+ result = np .logaddexp (a , NA )
240
240
tm .assert_numpy_array_equal (result , expected )
241
241
242
- result = np .logaddexp (pd . NA , a )
242
+ result = np .logaddexp (NA , a )
243
243
tm .assert_numpy_array_equal (result , expected )
244
244
245
245
# all NA, multiple inputs
246
- assert np .logaddexp (pd . NA , pd . NA ) is pd . NA
246
+ assert np .logaddexp (NA , NA ) is NA
247
247
248
- result = np .modf (pd . NA , pd . NA )
248
+ result = np .modf (NA , NA )
249
249
assert len (result ) == 2
250
- assert all (x is pd . NA for x in result )
250
+ assert all (x is NA for x in result )
251
251
252
252
253
253
def test_divmod_ufunc ():
254
254
# binary in, binary out.
255
255
a = np .array ([1 , 2 , 3 ])
256
- expected = np .array ([pd . NA , pd . NA , pd . NA ], dtype = object )
256
+ expected = np .array ([NA , NA , NA ], dtype = object )
257
257
258
- result = np .divmod (a , pd . NA )
258
+ result = np .divmod (a , NA )
259
259
assert isinstance (result , tuple )
260
260
for arr in result :
261
261
tm .assert_numpy_array_equal (arr , expected )
262
262
tm .assert_numpy_array_equal (arr , expected )
263
263
264
- result = np .divmod (pd . NA , a )
264
+ result = np .divmod (NA , a )
265
265
for arr in result :
266
266
tm .assert_numpy_array_equal (arr , expected )
267
267
tm .assert_numpy_array_equal (arr , expected )
@@ -286,17 +286,17 @@ def test_integer_hash_collision_set():
286
286
287
287
def test_pickle_roundtrip ():
288
288
# https://github.com/pandas-dev/pandas/issues/31847
289
- result = pickle .loads (pickle .dumps (pd . NA ))
290
- assert result is pd . NA
289
+ result = pickle .loads (pickle .dumps (NA ))
290
+ assert result is NA
291
291
292
292
293
293
def test_pickle_roundtrip_pandas ():
294
- result = tm .round_trip_pickle (pd . NA )
295
- assert result is pd . NA
294
+ result = tm .round_trip_pickle (NA )
295
+ assert result is NA
296
296
297
297
298
298
@pytest .mark .parametrize (
299
- "values, dtype" , [([1 , 2 , pd . NA ], "Int64" ), (["A" , "B" , pd . NA ], "string" )]
299
+ "values, dtype" , [([1 , 2 , NA ], "Int64" ), (["A" , "B" , NA ], "string" )]
300
300
)
301
301
@pytest .mark .parametrize ("as_frame" , [True , False ])
302
302
def test_pickle_roundtrip_containers (as_frame , values , dtype ):
0 commit comments