alamb commented on code in PR #14541:
URL: https://github.com/apache/datafusion/pull/14541#discussion_r1946990866


##########
datafusion/expr/src/udaf.rs:
##########
@@ -119,9 +119,12 @@ impl AggregateUDF {
     where
         F: AggregateUDFImpl + 'static,
     {
-        Self {
-            inner: Arc::new(fun),
-        }
+        Self::new_from_shared_impl(Arc::new(fun))
+    }
+
+    /// Create a new `AggregateUDF` from a `[AggregateUDFImpl]` trait object

Review Comment:
   > Into/From is very important for readability in some cases, but it can also 
[be 
abused](https://github.com/apache/datafusion/blob/d5ff3e7c247430865590c592587ad60fdff4bcc0/datafusion/common/src/scalar/mod.rs#L3453).
 Sometimes just single API method is enough
   
   I agree -- that one should be an API method (not just a From impl) to make 
it easier to find/use. Filed
   - https://github.com/apache/datafusion/issues/14548
   



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