Skip to content

Commit

Permalink
TST(string_dtype): Fix minor issue with CSV parser and column dtype
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAyd committed Jan 24, 2025
1 parent 354b61f commit 2888bf9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pandas/io/parsers/arrow_parser_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ def _finalize_pandas_output(self, frame: DataFrame) -> DataFrame:
# The only way self.names is not the same length as number of cols is
# if we have int index_col. We should just pad the names(they will get
# removed anyways) to expected length then.
self.names = list(range(num_cols - len(self.names))) + self.names
columns_prefix = [str(x) for x in range(num_cols - len(self.names))]
self.names = columns_prefix + self.names
multi_index_named = False
frame.columns = self.names

Expand Down
3 changes: 0 additions & 3 deletions pandas/tests/io/parser/common/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ def test_pass_names_with_index(all_parsers, data, kwargs, expected):
def test_multi_index_no_level_names(
request, all_parsers, index_col, using_infer_string
):
if using_infer_string and all_parsers.engine == "pyarrow":
# result should have string columns instead of object dtype
request.applymarker(pytest.mark.xfail(reason="TODO(infer_string)"))
data = """index1,index2,A,B,C,D
foo,one,2,3,4,5
foo,two,7,8,9,10
Expand Down

0 comments on commit 2888bf9

Please sign in to comment.