Mr-Nobody-Anonymous commented on code in PR #54691:
URL: https://github.com/apache/arrow/pull/54691#discussion_r4786235820
##########
python/pyarrow/tests/test_dataset.py:
##########
@@ -3567,6 +3568,29 @@ def test_csv_format_options_generate_columns(tempdir,
dataset_reader):
'f3': pa.array([1])}))
+def test_csv_format_pad_short_rows(tempdir, dataset_reader):
+ path = str(tempdir / 'short.csv')
+ with open(path, 'w') as sink:
+ sink.write('a,b,c\n1,2,3\n4,5\n6\n')
+
+ # Default format fails on short rows
+ with pytest.raises(pa.ArrowInvalid, match="Expected 3 columns, got 2:
4,5"):
+ dataset_default = ds.dataset(path, format='csv')
+ dataset_reader.to_table(dataset_default)
Review Comment:
Good catch @rok, thanks! Removed the unreachable to_table call and unused
assignment in commit 5426a74703.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]