We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8be0127 commit 7cbf0eaCopy full SHA for 7cbf0ea
pandas/core/internals/blocks.py
@@ -46,6 +46,7 @@
46
is_re_compilable,
47
is_sparse,
48
is_timedelta64_dtype,
49
+ is_string_dtype,
50
pandas_dtype,
51
)
52
from pandas.core.dtypes.dtypes import ExtensionDtype
@@ -1006,8 +1007,7 @@ def coerce_to_target_dtype(self, other):
1006
1007
and will receive the same block
1008
"""
1009
if isinstance(other, str):
- dtype = "string"
1010
- if is_dtype_equal(self.dtype, dtype):
+ if is_string_dtype(self.dtype):
1011
return self
1012
else:
1013
dtype = np.object_
0 commit comments