andygrove commented on code in PR #3468:
URL: https://github.com/apache/arrow-rs/pull/3468#discussion_r1062926741


##########
arrow-csv/src/reader/mod.rs:
##########
@@ -1124,6 +1124,31 @@ mod tests {
 
     use chrono::prelude::*;
 
+    #[test]
+    fn rows_unequal_length() {
+        let file = File::open("test/data/unequal_lengths.csv").unwrap();
+        let schema = Schema::new(vec![
+            Field::new("foo", DataType::Int32, false),
+            Field::new("bar", DataType::Int32, false),
+        ]);
+        let mut csv = Reader::new(
+            file,
+            Arc::new(schema.clone()),
+            false,
+            None,
+            1024,
+            None,
+            None,
+            None,
+        );
+        let batch = csv.next().unwrap();
+        assert!(batch.is_err());
+        assert_eq!(
+            "Csv error: incorrect number of fields, expected 2 got 3",

Review Comment:
   No line number is included here .. I wonder what is needed to have the csv 
crate populate the position in the error? I guess I have some research to do ...



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