alamb commented on code in PR #10141: URL: https://github.com/apache/datafusion/pull/10141#discussion_r1579267046
########## datafusion/execution/src/config.rs: ########## @@ -157,30 +157,34 @@ impl SessionConfig { } /// Set a configuration option - pub fn set(mut self, key: &str, value: ScalarValue) -> Self { - self.options.set(key, &value.to_string()).unwrap(); - self + pub fn set(self, key: &str, value: ScalarValue) -> Self { Review Comment: I think it still might be helpful to have `fn set` -- how about we leave it in this PR and we can propose a follow on PR to remove it. ########## datafusion/execution/src/config.rs: ########## @@ -157,30 +157,34 @@ impl SessionConfig { } /// Set a configuration option - pub fn set(mut self, key: &str, value: ScalarValue) -> Self { - self.options.set(key, &value.to_string()).unwrap(); - self + pub fn set(self, key: &str, value: ScalarValue) -> Self { + self.set_str(key, &value.to_string()) } /// Set a boolean configuration option pub fn set_bool(self, key: &str, value: bool) -> Self { - self.set(key, ScalarValue::Boolean(Some(value))) + self.set_str(key, &value.to_string()) } /// Set a generic `u64` configuration option pub fn set_u64(self, key: &str, value: u64) -> Self { - self.set(key, ScalarValue::UInt64(Some(value))) + self.set_str(key, &value.to_string()) } /// Set a generic `usize` configuration option pub fn set_usize(self, key: &str, value: usize) -> Self { - let value: u64 = value.try_into().expect("convert usize to u64"); - self.set(key, ScalarValue::UInt64(Some(value))) + self.set_str( + key, Review Comment: I had this PR checked out anyways to review, so I took the liberty of doing so in b730ee13e505cb23f2d09fe85756cd6aaf1b93f6 -- 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