Skip to content

Commit 078aca1

Browse files
committed
Remove hard-code
1 parent 8be0127 commit 078aca1

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
@@ -45,6 +45,7 @@
4545
is_re,
4646
is_re_compilable,
4747
is_sparse,
48+
is_string_dtype,
4849
is_timedelta64_dtype,
4950
pandas_dtype,
5051
)
@@ -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)