Skip to content

Commit 1bead7f

Browse files
committed
Use dtype_backend instead of is_object_dtype
1 parent 9eb9232 commit 1bead7f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pandas/io/sql.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
from pandas.core.dtypes.common import (
4646
is_dict_like,
4747
is_list_like,
48-
is_object_dtype,
4948
is_string_dtype,
5049
)
5150
from pandas.core.dtypes.dtypes import (
@@ -1322,7 +1321,7 @@ def _harmonize_columns(
13221321
elif (
13231322
using_string_dtype()
13241323
and is_string_dtype(col_type)
1325-
and is_object_dtype(self.frame[col_name])
1324+
and dtype_backend == "numpy"
13261325
):
13271326
self.frame[col_name] = df_col.astype(col_type)
13281327
elif dtype_backend == "numpy" and len(df_col) == df_col.count():

0 commit comments

Comments
 (0)