Skip to content

Commit d793899

Browse files
update docstring
1 parent 36624fc commit d793899

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

pandas/core/arrays/base.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ def _from_scalars(cls, scalars, *, dtype: DtypeObj) -> Self:
418418
)
419419
raise
420420

421-
def _cast_pointwise_result(self, values) -> ArrayLike:
421+
def _cast_pointwise_result(self, values, **kwargs) -> ArrayLike:
422422
"""
423423
Construct an ExtensionArray after a pointwise operation.
424424
@@ -430,9 +430,17 @@ def _cast_pointwise_result(self, values) -> ArrayLike:
430430
array with units, this method can return an int array with units).
431431
432432
If converting to your own ExtensionArray is not possible, this method
433-
can raise an error (TypeError or ValueError) or return the input
434-
`values` as-is. Then pandas will do the further type inference.
433+
falls back to returning an array with the default type inference.
434+
If you only need to cast to `self.dtype`, it is recommended to override
435+
`_from_scalars` instead of this method.
435436
437+
Parameters
438+
----------
439+
values : sequence
440+
441+
Returns
442+
-------
443+
ExtensionArray or ndarray
436444
"""
437445
try:
438446
return type(self)._from_scalars(values, dtype=self.dtype)

0 commit comments

Comments
 (0)