-
Notifications
You must be signed in to change notification settings - Fork 467
Generate text function docs #5238
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…17b64714ee7a8ae722'
@c-herrewijn Thanks for the PR and the detailed explanation! Users quite often send improvements to function documentations. Can you please update the |
The CI failure seems to be caused by the |
Mytherin
added a commit
to duckdb/duckdb
that referenced
this pull request
May 22, 2025
- updated a large number of function descriptions and examples, so they can serve as input for documentation generation - function examples in the catalog now match the function alias name - fixed a small bug: `\001` and `\002` are now used as separators in the function headers, instead of `\1` and `\2`. (3 octal digits prevent interfernce from consequtive numerical chars) related PR: duckdb/duckdb-web#5238 and duckdb/duckdb-web#5396
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The PR add functionality to the document generation script added in PR #5017
functionalities added to script:
generate_sql_function_docs.py
string_split_regex
,string_split_regex
, etc.)ltrim(string)
andltrim(string, characters)
...
is appended to the arguments, e.g. forleast
,greatest
etc. )usage examples
The function table will be generated or updated between the section start and end lines.
All data (e.g. parameter names, descriptions, examples) comes from the output of
duckdb_functions()
. Any deviations (exclusion, additions or overrides), need to be hardcoded in the scriptgenerate_sql_function_docs.py
via variablesOVERRIDES
andEXCLUDES
.The first time, the section start and end lines need to be added manually so the script can determine where to generate the funcion table. In this PR this has been done for
char.md
andblob.md
.The function categories that need can be set at the end of the start line, e.g.:
categories: [blob]
File
blob.md
File
char.md
has 2 function tables that will be populated.NOTES
regexp_extract_all(string, regex[, group = 0])
parameter_type
=ANY
. As a consequence the descriptions are more general. E.g. forconcat
the description now starts withConcatenates multiple strings, lists, or blobs
since it needs to make sense on all these different doc pages.regexp_split_to_array
exists with 3 different aliases, and 2 different signatures, so it is listed 3*2=6 timesOVERRIDES
Related PR: duckdb/duckdb#17132