Weijun-H commented on code in PR #18408:
URL: https://github.com/apache/datafusion/pull/18408#discussion_r2484998617


##########
datafusion/common/src/config.rs:
##########
@@ -1515,6 +1626,19 @@ macro_rules! config_field {
                 *self = $transform;
                 Ok(())
             }
+
+            fn reset(&mut self, key: &str) -> $crate::error::Result<()> {
+                if key.is_empty() {

Review Comment:
   For scalar config fields the caller already strips off the key for the field 
before invoking reset. At that point key only contains a nested suffix (if any).
   - key.is_empty() → we’re exactly at the scalar value, so resetting means 
“restore to default”, which we do.
   - non-empty key → someone tried to reset something below a scalar (e.g. 
foo.bar where foo is a scalar); that’s invalid, so we emit the helpful error.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to