Mr-Nobody-Anonymous commented on code in PR #54691:
URL: https://github.com/apache/arrow/pull/54691#discussion_r4628496969


##########
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
+    dataset_default = ds.dataset(path, format='csv')
+    with pytest.raises(pa.ArrowInvalid, match="Expected 3 columns, got 2: 
4,5"):
+        dataset_reader.to_table(dataset_default)

Review Comment:
   Fixed in commit b75d874. Dataset creation is now placed inside the 
pytest.raises context so schema inference exceptions are properly caught.



-- 
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]

Reply via email to