stantheman0128 opened a new pull request, #1684:
URL: https://github.com/apache/datafusion-python/pull/1684

   # 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`:
   
   - `regexp_like`
   - `regexp_match`
   - `regexp_replace`
   - `regexp_count`
   
   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:
   
   ```console
   $ pre-commit run --files python/datafusion/functions/__init__.py
   Lint GitHub Actions workflow files...................(no files to 
check)Skipped
   ruff (legacy 
alias)......................................................Passed
   ruff 
format..............................................................Passed
   Rust fmt.............................................(no files to 
check)Skipped
   Rust clippy..........................................(no files to 
check)Skipped
   
codespell................................................................Passed
   uv-lock..............................................(no files to 
check)Skipped
   ```
   
   Ruff on its own, pinned to the version in `.pre-commit-config.yaml`:
   
   ```console
   $ [email protected] check --config pyproject.toml 
python/datafusion/functions/__init__.py
   All checks passed!
   $ [email protected] format --check --config pyproject.toml 
python/datafusion/functions/__init__.py
   1 file already formatted
   ```
   
   The repository enables `--doctest-modules` over `python/datafusion`, so the 
examples
   in these docstrings run as tests. Against a locally built extension:
   
   ```console
   $ pytest python/datafusion/functions/__init__.py -q -k regexp
   5 passed, 231 deselected, 2 warnings in 2.39s
   
   $ pytest python/datafusion/functions/__init__.py -q
   236 passed, 2 warnings in 2.06s
   ```
   
   Whitespace:
   
   ```console
   $ git diff --check
   ```
   
   # LLM-generated code disclosure
   
   These docstring additions were prepared with the assistance of Claude and 
reviewed
   against each function signature before submission.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to