docs: document regular expression function arguments - #1684
Open
stantheman0128 wants to merge 1 commit into
Open
docs: document regular expression function arguments#1684stantheman0128 wants to merge 1 commit into
stantheman0128 wants to merge 1 commit into
Conversation
regexp_instr documents its parameters in an Args section, the other four regexp functions document none. Adds Args to regexp_like, regexp_match, regexp_replace and regexp_count, reusing the wording regexp_instr already uses for the parameters they share.
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
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.
Which issue does this PR close?
Related to #1463.
Rationale for this change
regexp_instrdocuments every parameter it takes in anArgs:section. The fourother
regexp_*functions document none. Someone reading the generated API docs tofind out what
flagsaccepts, or wherestartcounts from, gets an answer for onefunction in the family and nothing for the rest.
This is the same kind of small focused pass as #1527, applied to the regular
expression family.
What changes are included in this PR?
Adds an
Args:section to four functions inpython/datafusion/functions/__init__.py:regexp_likeregexp_matchregexp_replaceregexp_countWhere a parameter also exists on
regexp_instr(regex,start,flags), thewording follows what
regexp_instralready says, so the family reads consistently.The
flagsentry onregexp_replacealso records thegbehavior that the proseabove it and its own example already show.
Nothing else in the file changes. Signatures, type hints, runtime code, and existing
examples are untouched.
Are there any user-facing changes?
Yes, documentation only. The generated API docs now list argument descriptions for
these four functions. Runtime behavior is unchanged.
Validation
Pre-commit, scoped to the changed file:
Ruff on its own, pinned to the version in
.pre-commit-config.yaml:The repository enables
--doctest-modulesoverpython/datafusion, so the examplesin these docstrings run as tests. Against a locally built extension:
Whitespace:
$ git diff --checkLLM-generated code disclosure
These docstring additions were prepared with the assistance of Claude and reviewed
against each function signature before submission.