Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple alternative syntaxes in the user_doc macro, port trim to use new macro #13952

Merged
merged 1 commit into from
Dec 31, 2024

Conversation

delamarch3
Copy link
Contributor

Which issue does this PR close?

Closes #13944

Rationale for this change

As explained in #13944, the user_doc macro doesn't support multiple alternative syntaxes which has prevented trim from using it.

What changes are included in this PR?

Build a list of alternative syntax examples in the macro
Use user_doc for trim

Are these changes tested?

I have run ./dev/update_function_docs.sh and there are no changes

Are there any user-facing changes?

No

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @delamarch3 -- this is great !

FYI @comphead and @Chen-Yuan-Lai

@@ -258,7 +258,7 @@ pub fn user_doc(args: TokenStream, input: TokenStream) -> TokenStream {
datafusion_doc::Documentation::builder(datafusion_doc::DocSection { include: #doc_section_include, label: #doc_section_lbl, description: #doc_section_description },
#description.to_string(), #syntax_example.to_string())
#sql_example
#alt_syntax_example
#(#alt_syntax_example)*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤯 -- very nice @delamarch3

Thank you

@alamb alamb changed the title Support multiple alternative syntaxes in the user_doc macro Support multiple alternative syntaxes in the user_doc macro, port trim to use new macro Dec 31, 2024
@alamb alamb added the documentation Improvements or additions to documentation label Dec 31, 2024
Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm thanks @delamarch3

@comphead comphead merged commit 9d39358 into apache:main Dec 31, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update the user_doc() macro to support multiple alternative syntaxes
3 participants