This is an automated email from the ASF dual-hosted git repository.
ruifengz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 2f574594acfc [MINOR][PYTHON][DOCS] Fix the docstring of `assert_true`
2f574594acfc is described below
commit 2f574594acfc027f65581d690119b2d11f09b22f
Author: Ruifeng Zheng <[email protected]>
AuthorDate: Fri Oct 17 15:23:29 2025 +0800
[MINOR][PYTHON][DOCS] Fix the docstring of `assert_true`
### What changes were proposed in this pull request?
Fix the docstring of `assert_true`
### Why are the changes needed?
the old example is not correct
### Does this PR introduce _any_ user-facing change?
doc-only change
### How was this patch tested?
enabled doctest
### Was this patch authored or co-authored using generative AI tooling?
no
Closes #52644 from zhengruifeng/fix_doc_assert_ture.
Authored-by: Ruifeng Zheng <[email protected]>
Signed-off-by: Ruifeng Zheng <[email protected]>
---
python/pyspark/sql/functions/builtin.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/python/pyspark/sql/functions/builtin.py
b/python/pyspark/sql/functions/builtin.py
index 24baace54621..85115f132d44 100644
--- a/python/pyspark/sql/functions/builtin.py
+++ b/python/pyspark/sql/functions/builtin.py
@@ -13962,12 +13962,12 @@ def assert_true(col: "ColumnOrName", errMsg:
Optional[Union[Column, str]] = None
--------
>>> import pyspark.sql.functions as sf
>>> df = spark.createDataFrame([(0, 1)], ['a', 'b'])
- >>> df.select('*', sf.assert_true(df.a < df.b)).show() # doctest: +SKIP
- +------------------------------------------------------+
- |assert_true((a < b), '(a#788L < b#789L)' is not true!)|
- +------------------------------------------------------+
- | NULL|
- +------------------------------------------------------+
+ >>> df.select('*', sf.assert_true(df.a < df.b)).show()
+ +---+---+--------------------------------------------+
+ | a| b|assert_true((a < b), '(a < b)' is not true!)|
+ +---+---+--------------------------------------------+
+ | 0| 1| NULL|
+ +---+---+--------------------------------------------+
>>> df.select('*', sf.assert_true(df.a < df.b, df.a)).show()
+---+---+-----------------------+
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]