| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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.
There was a problem hiding this comment.
Nit about not repeating information already captured in doc string since we can test the validity of doc strings but can't test the free text stays up to date. Applies to all the optional call outs.
Sorry, something went wrong.
| Args: | ||
| string: Data to test against the regular expression. | ||
| regex: Regular expression to search for. | ||
| flags: Optional regular expression flags to control regex behavior. |
There was a problem hiding this comment.
| flags: Optional regular expression flags to control regex behavior. | |
| flags: Flags to control regex behavior. |
NIT: Optional is implied by the = None
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Which issue does this PR close?
Related to #1463.
Rationale for this change
regexp_instr documents every parameter it takes in an Args: section. The four
other regexp_* functions document none. Someone reading the generated API docs to
find out what flags accepts, or where start counts from, gets an answer for one
function 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 in python/datafusion/functions/__init__.py:
Where a parameter also exists on regexp_instr (regex, start, flags), the
wording follows what regexp_instr already says, so the family reads consistently.
The flags entry on regexp_replace also records the g behavior that the prose
above 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-modules over python/datafusion, so the examples
in 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.