nuno-faria commented on code in PR #15712:
URL: https://github.com/apache/datafusion/pull/15712#discussion_r2044454488


##########
datafusion/execution/src/config.rs:
##########
@@ -193,9 +193,11 @@ impl SessionConfig {
     ///
     /// [`target_partitions`]: 
datafusion_common::config::ExecutionOptions::target_partitions
     pub fn with_target_partitions(mut self, n: usize) -> Self {
-        // partition count must be greater than zero
-        assert!(n > 0);
-        self.options.execution.target_partitions = n;
+        self.options.execution.target_partitions = if n == 0 {
+            
datafusion_common::config::ExecutionOptions::default().target_partitions
+        } else {
+            n
+        };

Review Comment:
   Should this stay the same or use 
`self.options.execution.set("target_partitions", &n.to_string()).unwrap()`?



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