-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: Migrate aggregate functions doc to attribute based. #13646
Conversation
@@ -281,11 +281,11 @@ first_value(expression [ORDER BY expression]) | |||
#### Example | |||
|
|||
```sql | |||
> SELECT first_value(column_name ORDER BY other_column) FROM table_name; | |||
> SELECT last_value(column_name ORDER BY other_column) FROM table_name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the documentation fixed now.
There is an existing bug when documentation lock with the same name covers 2 or more doc functions in the same file. In this scenario documentation will pick the first available doc description which is unexpected. The migration to macros fixes the problem as it uses separate lock per function
// | ||
// let file_path = format!("{}.txt", name); | ||
// if std::path::Path::new(&file_path).exists() { | ||
// std::fs::remove_file(&file_path).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking of leaving it for now as this part generates text files with attribute text so its easier to do a migration for remaning parts(windows/builtin udfs), semi automatic way instead of manual
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just add a small comment noting this is useful for migration purposes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree a comment explaining what this is used for would be most helpful
I'll do my best to look at this tonight or tomorrow but I'm juggling a lot atm. I am on vacation next week and I hope to be able to work on my backlog a bit then which currently stands at:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me - thx for spending the time to push through this improvement!
// | ||
// let file_path = format!("{}.txt", name); | ||
// if std::path::Path::new(&file_path).exists() { | ||
// std::fs::remove_file(&file_path).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just add a small comment noting this is useful for migration purposes.
.unwrap_or_default(), | ||
); | ||
|
||
let st_arg_token = " expression to operate on. Can be a constant, column, or function, and any combination of operators."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this could be extracted to a constant and that used instead of having text copies of the string in 2 places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// | ||
// let file_path = format!("{}.txt", name); | ||
// if std::path::Path::new(&file_path).exists() { | ||
// std::fs::remove_file(&file_path).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree a comment explaining what this is used for would be most helpful
@@ -63,6 +63,88 @@ impl Documentation { | |||
) -> DocumentationBuilder { | |||
DocumentationBuilder::new(doc_section, description, syntax_example) | |||
} | |||
|
|||
/// Output the `Documentation` struct in form of custom Rust documentation attributes | |||
pub fn to_doc_attribute(&self) -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would also help helpful here to note this is to help migration to doc comment attributes
Which issue does this PR close?
Closes #.
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?