andygrove commented on code in PR #163:
URL: 
https://github.com/apache/arrow-datafusion-python/pull/163#discussion_r1096541016


##########
src/dataframe.rs:
##########
@@ -302,4 +302,10 @@ impl PyDataFrame {
         wait_for_future(py, self.df.as_ref().clone().write_json(path))?;
         Ok(())
     }
+
+    // Executes this DataFrame to get the total number of rows.
+    fn count(&self, py: Python) -> PyResult<usize> {
+        let count = wait_for_future(py, self.df.as_ref().clone().count());
+        Ok(count.unwrap())

Review Comment:
   The `unwrap` can be avoided here:
   
   ```suggestion
           let count = wait_for_future(py, self.df.as_ref().clone().count());
           Ok(count.unwrap())
   ```
   ```suggestion
           Ok(wait_for_future(py, self.df.as_ref().clone().count())?)
   ```



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