jonathanc-n commented on code in PR #12926:
URL: https://github.com/apache/datafusion/pull/12926#discussion_r1800171327


##########
datafusion/expr/src/udf_docs.rs:
##########
@@ -149,21 +149,35 @@ impl DocumentationBuilder {
     ///
     /// This is similar to  [`Self::with_argument`] except that  a standard
     /// description is appended to the end: `"Can be a constant, column, or
-    /// function, and any combination of arithmetic operators."`
+    /// function, and any combination of arithmetic operators."` There is
+    /// also a default option for if the argument was "expression".
     ///
-    /// The argument is rendered like
+    /// The argument is rendered like below if Some() is passed through:
     ///
     /// ```text
     /// <arg_name>:
     ///   <expression_type> expression to operate on. Can be a constant, 
column, or function, and any combination of operators.
     /// ```
+    ///
+    /// The argument is rendered like below if None is passed through:
+    ///
+    ///  ```text
+    /// <arg_name>:
+    ///   The expression to operate on. Can be a constant, column, or 
function, and any combination of operators.
+    /// ```
     pub fn with_standard_argument(
         self,
         arg_name: impl Into<String>,
-        expression_type: impl AsRef<str>,
+        expression_type: Option<&str>, // Changed from Option<T>
     ) -> Self {
-        let expression_type = expression_type.as_ref();
-        self.with_argument(arg_name, format!("{expression_type} expression to 
operate on. Can be a constant, column, or function, and any combination of 
operators."))
+        let description = match expression_type {
+            Some(expr_type) => format!(

Review Comment:
   ```
   pub fn with_standard_argument(
           self,
           arg_name: impl Into<String>,
           expression_type: Option<&str>, // Changed from Option<T>
       ) -> Self {
           let description = format!(
               "{} expression to operate on. Can be a constant, column, or 
function, and any combination of operators.",
               expression_type.unwrap_or("The")
           );
           self.with_argument(arg_name, description)
       }
       ```
       
       does something like this look good?
       



##########
datafusion/expr/src/udf_docs.rs:
##########
@@ -149,21 +149,35 @@ impl DocumentationBuilder {
     ///
     /// This is similar to  [`Self::with_argument`] except that  a standard
     /// description is appended to the end: `"Can be a constant, column, or
-    /// function, and any combination of arithmetic operators."`
+    /// function, and any combination of arithmetic operators."` There is
+    /// also a default option for if the argument was "expression".
     ///
-    /// The argument is rendered like
+    /// The argument is rendered like below if Some() is passed through:
     ///
     /// ```text
     /// <arg_name>:
     ///   <expression_type> expression to operate on. Can be a constant, 
column, or function, and any combination of operators.
     /// ```
+    ///
+    /// The argument is rendered like below if None is passed through:
+    ///
+    ///  ```text
+    /// <arg_name>:
+    ///   The expression to operate on. Can be a constant, column, or 
function, and any combination of operators.
+    /// ```
     pub fn with_standard_argument(
         self,
         arg_name: impl Into<String>,
-        expression_type: impl AsRef<str>,
+        expression_type: Option<&str>, // Changed from Option<T>
     ) -> Self {
-        let expression_type = expression_type.as_ref();
-        self.with_argument(arg_name, format!("{expression_type} expression to 
operate on. Can be a constant, column, or function, and any combination of 
operators."))
+        let description = match expression_type {
+            Some(expr_type) => format!(

Review Comment:
   @Omega359 
   



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