Skip to content

Commit 7cbf0ea

Browse files
committed
Remove hard-code
1 parent 8be0127 commit 7cbf0ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/core/internals/blocks.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
is_re_compilable,
4747
is_sparse,
4848
is_timedelta64_dtype,
49+
is_string_dtype,
4950
pandas_dtype,
5051
)
5152
from pandas.core.dtypes.dtypes import ExtensionDtype
@@ -1006,8 +1007,7 @@ def coerce_to_target_dtype(self, other):
10061007
and will receive the same block
10071008
"""
10081009
if isinstance(other, str):
1009-
dtype = "string"
1010-
if is_dtype_equal(self.dtype, dtype):
1010+
if is_string_dtype(self.dtype):
10111011
return self
10121012
else:
10131013
dtype = np.object_

0 commit comments

Comments
 (0)