Skip to content

Commit

Permalink
[MINOR][DOCS] Fix the type hints of `functions.first(..., ignorenulls…
Browse files Browse the repository at this point in the history
…)` and `functions.last(..., ignorenulls)`

### What changes were proposed in this pull request?

This PR proposes to fix the type hints of `functions.first(..., ignorenulls)` and `functions.last(..., ignorenulls)` to be properly `bool`s.

### Why are the changes needed?

To guide users about the correct types

### Does this PR introduce _any_ user-facing change?

Yes, it changes the user-facing documentation.

### How was this patch tested?

CI in this PR should verify them.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes apache#47151 from HyukjinKwon/minor-doc-fix.

Authored-by: Hyukjin Kwon <[email protected]>
Signed-off-by: Ruifeng Zheng <[email protected]>
  • Loading branch information
HyukjinKwon authored and zhengruifeng committed Jul 1, 2024
1 parent f70ce13 commit 399980e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/pyspark/sql/functions/builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5474,8 +5474,8 @@ def first(col: "ColumnOrName", ignorenulls: bool = False) -> Column:
----------
col : :class:`~pyspark.sql.Column` or str
column to fetch first value for.
ignorenulls : :class:`~pyspark.sql.Column` or str
if first value is null then look for first non-null value.
ignorenulls : bool
if first value is null then look for first non-null value. ``False``` by default.

Returns
-------
Expand Down Expand Up @@ -5747,8 +5747,8 @@ def last(col: "ColumnOrName", ignorenulls: bool = False) -> Column:
----------
col : :class:`~pyspark.sql.Column` or str
column to fetch last value for.
ignorenulls : :class:`~pyspark.sql.Column` or str
if last value is null then look for non-null value.
ignorenulls : bool
if last value is null then look for non-null value. ``False``` by default.

Returns
-------
Expand Down

0 comments on commit 399980e

Please sign in to comment.