findepi commented on code in PR #13576:
URL: https://github.com/apache/datafusion/pull/13576#discussion_r1874535271


##########
datafusion/common/src/config.rs:
##########
@@ -973,16 +980,24 @@ impl<F: ConfigField + Default> ConfigField for Option<F> {
 
 #[macro_export]
 macro_rules! config_field {
-    ($t:ty) => {
+    ($t:ty $(, $transform:expr)?) => {
         impl ConfigField for $t {
             fn visit<V: Visit>(&self, v: &mut V, key: &str, description: 
&'static str) {
                 v.some(key, self, description)
             }
 
             fn set(&mut self, _: &str, value: &str) -> Result<()> {
+                $(
+                    let value = $transform(&value);

Review Comment:
   Can the transform and parse be one step?
   
   if 'transform' is defined, this is what gets converts string input to 
desired value
   else the 'value.parse()` is used.
   
   this would allow more naturally express input-to-value transformation 
without having to define "normalized string format".
   
   wdyt?



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