Skip to content

Commit bcc7436

Browse files
committed
51044
if isinstance(value, str): raise ValueError("String values are not allowed in an integer array.")
1 parent 4eac590 commit bcc7436

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

asv_bench/benchmarks/arithmetic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import numpy as np
55

6-
import pandas as pd
6+
import pandas as pd
77
from pandas import (
88
DataFrame,
99
Series,

pandas/core/arrays/numpy_.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -589,5 +589,6 @@ def _validate_setitem_value(self, value):
589589

590590
# Note: without the "str" here, the f-string rendering raises in
591591
# py38 builds.
592-
raise TypeError(f"Invalid value '{str(value)}' for dtype {self.dtype}")
592+
if isinstance(value, str):
593+
raise TypeError(f"Invalid value '{str(value)}' for dtype {self.dtype}")
593594

0 commit comments

Comments
 (0)