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

doc-gen: make user_doc to work with predefined consts #14086

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

ding-young
Copy link
Contributor

Which issue does this PR close?

Closes #14001 .

Rationale for this change

What changes are included in this PR?

This pr modifies user_doc to find label only for given doc_section attribute and try correspondent const from predefined DocSections. If there is no match but label exists, (ex. General Functions) it will automatically fill include and description with default value as before.

Are these changes tested?

will test with github CI.

Are there any user-facing changes?

@github-actions github-actions bot added the logical-expr Logical plan and expressions label Jan 11, 2025
@comphead
Copy link
Contributor

Thanks @ding-young I think we are very close.

@comphead
Copy link
Contributor

For MSRV I believe you need to update the codebase and run cargo update in datafusion-cli folder

Comment on lines 189 to 194
if doc_section_lbl.is_none() {
eprintln!("label for doc_section should exist");
}
let label = doc_section_lbl.as_ref().unwrap().value();
// Try to find a predefined const by label first.
// If there is no match but label exists, default value will be used for include and description
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made the changes here

Comment on lines 28 to 29
/// For `doc_section`, this macro will try to find corresponding predefined `DocSection` by label field
/// Predefined `DocSection` can be found in datafusion/expr/src/udf.rs
Copy link
Contributor Author

Choose a reason for hiding this comment

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

also documented here

@ding-young ding-young force-pushed the doc-section branch 2 times, most recently from d00e65a to 0590e5f Compare January 15, 2025 11:27
@ding-young
Copy link
Contributor Author

@comphead Thank you for review. Please tell me if there is any suggestion about the documentation or else.

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 @ding-young for doing this PR

@comphead comphead merged commit 80d3131 into apache:main Jan 15, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
logical-expr Logical plan and expressions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Doc attribution: make user_doc to work with predefined consts.
2 participants