alamb commented on code in PR #2729:
URL: https://github.com/apache/arrow-rs/pull/2729#discussion_r972235965


##########
arrow/src/ipc/reader.rs:
##########
@@ -1692,10 +1689,9 @@ mod tests {
     #[test]
     fn test_no_columns_batch() {
         let schema = Arc::new(Schema::new(vec![]));
-        let options = RecordBatchOptions {
-            match_field_names: true,
-            row_count: Some(10),
-        };
+        let options = RecordBatchOptions::new()

Review Comment:
   ❤️ 



##########
arrow/src/record_batch.rs:
##########
@@ -413,15 +413,29 @@ pub struct RecordBatchOptions {
     pub row_count: Option<usize>,
 }
 
-impl Default for RecordBatchOptions {
-    fn default() -> Self {
+impl RecordBatchOptions {
+    pub fn new() -> Self {
         Self {
             match_field_names: true,
             row_count: None,
         }
     }
+    //Sets the row_count of RecordBatchOptions and returns self

Review Comment:
   ```suggestion
       /// Sets the row_count of RecordBatchOptions and returns self
   ```



##########
arrow/src/record_batch.rs:
##########
@@ -413,15 +413,29 @@ pub struct RecordBatchOptions {
     pub row_count: Option<usize>,
 }
 
-impl Default for RecordBatchOptions {
-    fn default() -> Self {
+impl RecordBatchOptions {
+    pub fn new() -> Self {
         Self {
             match_field_names: true,
             row_count: None,
         }
     }
+    //Sets the row_count of RecordBatchOptions and returns self

Review Comment:
   without `///` these comments will not appear in the 
https://docs.rs/arrow/latest/arrow/index.html docs



##########
arrow/src/record_batch.rs:
##########
@@ -413,15 +413,29 @@ pub struct RecordBatchOptions {
     pub row_count: Option<usize>,
 }
 
-impl Default for RecordBatchOptions {
-    fn default() -> Self {
+impl RecordBatchOptions {
+    pub fn new() -> Self {
         Self {
             match_field_names: true,
             row_count: None,
         }
     }
+    //Sets the row_count of RecordBatchOptions and returns self
+    pub fn with_row_count(mut self, row_count: Option<usize>) -> Self {
+        self.row_count = row_count;
+        self
+    }
+    //Sets the match_field_names of RecordBatchOptions and returns self

Review Comment:
   ```suggestion
       /// Sets the match_field_names of RecordBatchOptions and returns self
   ```



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