@@ -428,10 +428,14 @@ def to_numpy(
428
428
"for this dtype."
429
429
)
430
430
# don't pass copy to astype -> always need a copy since we are mutating
431
- data = self ._data .astype (dtype )
431
+ with warnings .catch_warnings ():
432
+ warnings .filterwarnings ("ignore" )
433
+ data = self ._data .astype (dtype )
432
434
data [self ._mask ] = na_value
433
435
else :
434
- data = self ._data .astype (dtype , copy = copy )
436
+ with warnings .catch_warnings ():
437
+ warnings .filterwarnings ("ignore" )
438
+ data = self ._data .astype (dtype , copy = copy )
435
439
return data
436
440
437
441
@doc (ExtensionArray .tolist )
@@ -464,7 +468,10 @@ def astype(self, dtype: AstypeArg, copy: bool = True) -> ArrayLike:
464
468
# if we are astyping to another nullable masked dtype, we can fastpath
465
469
if isinstance (dtype , BaseMaskedDtype ):
466
470
# TODO deal with NaNs for FloatingArray case
467
- data = self ._data .astype (dtype .numpy_dtype , copy = copy )
471
+ with warnings .catch_warnings ():
472
+ warnings .filterwarnings ("ignore" )
473
+ # TODO: Is rounding what we want long term?
474
+ data = self ._data .astype (dtype .numpy_dtype , copy = copy )
468
475
# mask is copied depending on whether the data was copied, and
469
476
# not directly depending on the `copy` keyword
470
477
mask = self ._mask if data is self ._data else self ._mask .copy ()
0 commit comments