alamb commented on code in PR #14011:
URL: https://github.com/apache/datafusion/pull/14011#discussion_r1903315465


##########
datafusion/core/src/datasource/memory.rs:
##########
@@ -333,7 +337,11 @@ impl DisplayAs for MemSink {
 }
 
 impl MemSink {
+    /// Creates a new [`MemSink`].
+    ///
+    /// The caller is responsible for ensuring that there is at least one 
partition to insert into.

Review Comment:
   I think you could avoid the assert / panic here by changing the `new` method 
to `try_new` and return a `Result` so it could be an error if the batches is 
empty (and move the check to try_new)
   
   However, I agree this PR is an improvement over what is currently on main so 
this PR is good to merge as is.
   
   ALso I double checked and `MemSink` is not part of the Public API so this 
seems reasonable to me



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to