Skip to content

Commit 770edf3

Browse files
committed
cast pyarrow
1 parent 044f0a1 commit 770edf3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/core/arrays/arrow/array.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,8 @@ def round(self, decimals: int = 0, *args, **kwargs) -> Self:
10961096
"""
10971097
if not self.dtype._is_numeric or self.dtype._is_boolean:
10981098
raise TypeError("Cannot round non-numeric type.")
1099-
return type(self)(pc.round(self._pa_array, ndigits=decimals))
1099+
result = pc.round(self._pa_array, ndigits=decimals)
1100+
return type(self)(result.cast(self._pa_array.type))
11001101

11011102
@doc(ExtensionArray.searchsorted)
11021103
def searchsorted(

0 commit comments

Comments
 (0)