Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pandas/io/parsers/arrow_parser_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def handle_warning(invalid_row) -> str:
]

self.read_options = {
"column_names": [] if self.header is None else self.kwds["names"],
"autogenerate_column_names": self.header is None,
"skip_rows": self.header
if self.header is not None
Expand Down
11 changes: 11 additions & 0 deletions pandas/tests/io/parser/common/test_common_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ def test_csv_mixed_type(all_parsers):
tm.assert_frame_equal(result, expected)


def test_read_csv_single_line(all_parsers):
# GH62635
parser = all_parsers
table = parser.read_csv(
StringIO("1,2,3\n"),
names=["col1", "col2", "col3"],
)
expected = DataFrame({"col1": [1], "col2": [2], "col3": [3]})
tm.assert_frame_equal(table, expected)


def test_read_csv_low_memory_no_rows_with_index(all_parsers):
# see gh-21141
parser = all_parsers
Expand Down
Loading