comphead commented on code in PR #10141:
URL:
https://github.com/apache/arrow-datafusion/pull/10141#discussion_r1572599066
##########
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:
do we need this conversion to u64? afaik its possible to convert usize
directly to string
--
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]