|
17 | 17 | import pandas._libs.ops as libops |
18 | 18 | import pandas._libs.parsers as parsers |
19 | 19 | from pandas._libs.tslibs import parsing |
20 | | -import pandas.compat as compat |
21 | 20 | from pandas.errors import ( |
22 | 21 | AbstractMethodError, EmptyDataError, ParserError, ParserWarning) |
23 | 22 | from pandas.util._decorators import Appender |
24 | 23 |
|
25 | 24 | from pandas.core.dtypes.cast import astype_nansafe |
26 | 25 | from pandas.core.dtypes.common import ( |
27 | | - ensure_object, is_bool_dtype, is_categorical_dtype, is_dtype_equal, |
28 | | - is_extension_array_dtype, is_float, is_integer, is_integer_dtype, |
29 | | - is_list_like, is_object_dtype, is_scalar, is_string_dtype, pandas_dtype) |
| 26 | + ensure_object, ensure_str, is_bool_dtype, is_categorical_dtype, |
| 27 | + is_dtype_equal, is_extension_array_dtype, is_float, is_integer, |
| 28 | + is_integer_dtype, is_list_like, is_object_dtype, is_scalar, |
| 29 | + is_string_dtype, pandas_dtype) |
30 | 30 | from pandas.core.dtypes.dtypes import CategoricalDtype |
31 | 31 | from pandas.core.dtypes.missing import isna |
32 | 32 |
|
@@ -1494,7 +1494,7 @@ def extract(r): |
1494 | 1494 | # If we find unnamed columns all in a single |
1495 | 1495 | # level, then our header was too long. |
1496 | 1496 | for n in range(len(columns[0])): |
1497 | | - if all(compat.to_str(c[n]) in self.unnamed_cols for c in columns): |
| 1497 | + if all(ensure_str(col[n]) in self.unnamed_cols for col in columns): |
1498 | 1498 | raise ParserError( |
1499 | 1499 | "Passed header=[{header}] are too many rows for this " |
1500 | 1500 | "multi_index of columns" |
|
0 commit comments