You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea is to migrate the trim function to use the doc macros
However, when @Chen-Yuan-Lai tried to do so in #13924 we found that the second alternative_syntax was ignored
Here is the rust change:
#[user_doc( doc_section(label = "String Functions"), description = "Trims the specified trim string from the start and end of a string. If no trim string is provided, all whitespace is removed from the start and end of the input string.", syntax_example = "btrim(str[, trim_str])", alternative_syntax = "trim(BOTH trim_str FROM str)", alternative_syntax = "trim(trim_str FROM str)", sql_example = r#"```sql> select btrim('__datafusion____', '_');+-------------------------------------------+| btrim(Utf8("__datafusion____"),Utf8("_")) |+-------------------------------------------+| datafusion |+-------------------------------------------+```"#, standard_argument(name = "str", prefix = "String"), argument( name = "trim_str", description = "String expression to operate on. Can be a constant, column, or function, and any combination of operators. _Default is whitespace characters._"), related_udf(name = "ltrim"), related_udf(name = "rtrim"))]#[derive(Debug)]pubstructBTrimFunc{signature:Signature,
Then regenerate the documentation:
./dev/update_function_docs.sh
And you'll see that the second syntax is gone
#### Alternative Syntax-```sql-trim(BOTH trim_str FROM str)-```
```sql
trim(trim_str FROM str)
The text was updated successfully, but these errors were encountered:
alamb
changed the title
@comphead I found that use_doc() only supports one alternative syntax. Should we modify it to support multiple alternative syntaxes?
Update the user_doc() macro to support multiple alternative syntaxes
Dec 30, 2024
Related to doc-gen: Migrate builtin scalar functions from code based documentation to attribute based #13671
Originally posted by @Chen-Yuan-Lai in #13924 (comment)
The idea is to migrate the
trim
function to use the doc macrosHowever, when @Chen-Yuan-Lai tried to do so in #13924 we found that the second
alternative_syntax
was ignoredHere is the rust change:
Then regenerate the documentation:
And you'll see that the second syntax is gone
The text was updated successfully, but these errors were encountered: