Skip to content

Commit 77eb146

Browse files
committed
Adjust error messages
1 parent 347463e commit 77eb146

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

pandas/core/apply.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,22 +305,25 @@ def validate_values_for_numba(obj: Series | DataFrame) -> None:
305305
if isinstance(obj, Series):
306306
if not is_numeric_dtype(obj.dtype):
307307
raise ValueError(
308-
f"Series must have numeric dtype. Found '{dtype}'."
308+
f"Series must have a numeric dtype. "
309+
f"Found '{dtype}' instead"
309310
)
310311
if is_extension_array_dtype(obj.dtype):
311312
raise ValueError(
312-
f"Series uses extension array dtype, not supported by Numba."
313+
f"Series is backed by an extension array, "
314+
f"which is not supported by the numba engine."
313315
)
314316
else:
315317
for colname, dtype in obj.dtypes.items():
316318
if not is_numeric_dtype(dtype):
317319
raise ValueError(
318-
f"Column {colname} must have numeric dtype. Found '{dtype}'."
320+
f"Column {colname} must have a numeric dtype. "
321+
f"Found '{dtype}' instead"
319322
)
320323
if is_extension_array_dtype(dtype):
321324
raise ValueError(
322-
f"Column {colname} uses extension array dtype, "
323-
"not supported by Numba."
325+
f"Column {colname} is backed by an extension array, "
326+
f"which is not supported by the numba engine."
324327
)
325328

326329
@staticmethod

0 commit comments

Comments
 (0)