From d6a30277c16619732ce670515f1f6ab9101e5ff8 Mon Sep 17 00:00:00 2001 From: judy <1169859401@qq.com> Date: Fri, 13 Mar 2026 16:41:50 -0700 Subject: [PATCH 1/5] [SPARK-55357][PYTHON] Fix docstring for timestamp_add --- python/pyspark/sql/functions/builtin.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/python/pyspark/sql/functions/builtin.py b/python/pyspark/sql/functions/builtin.py index a3b511aac2627..92631d7759a05 100644 --- a/python/pyspark/sql/functions/builtin.py +++ b/python/pyspark/sql/functions/builtin.py @@ -13068,15 +13068,14 @@ def timestamp_diff(unit: str, start: "ColumnOrName", end: "ColumnOrName") -> Col @_try_remote_functions def timestamp_add(unit: str, quantity: "ColumnOrName", ts: "ColumnOrName") -> Column: """ - Gets the difference between the timestamps in the specified units by truncating - the fraction part. + Adds the specified number of units to the given timestamp. .. versionadded:: 4.0.0 Parameters ---------- unit : literal string - This indicates the units of the difference between the given timestamps. + This indicates the units of datetime that you want to add. Supported options are (case insensitive): "YEAR", "QUARTER", "MONTH", "WEEK", "DAY", "HOUR", "MINUTE", "SECOND", "MILLISECOND" and "MICROSECOND". quantity : :class:`~pyspark.sql.Column` or column name @@ -13087,7 +13086,7 @@ def timestamp_add(unit: str, quantity: "ColumnOrName", ts: "ColumnOrName") -> Co Returns ------- :class:`~pyspark.sql.Column` - the difference between the timestamps. + the resulting timestamp after adding the specified number of units. See Also -------- From ff974b1a03c23e4b4f917b5bf0ab0fa8fbe01905 Mon Sep 17 00:00:00 2001 From: judy <1169859401@qq.com> Date: Fri, 13 Mar 2026 17:05:43 -0700 Subject: [PATCH 2/5] update --- python/pyspark/sql/functions/builtin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pyspark/sql/functions/builtin.py b/python/pyspark/sql/functions/builtin.py index 92631d7759a05..c543fa5207dee 100644 --- a/python/pyspark/sql/functions/builtin.py +++ b/python/pyspark/sql/functions/builtin.py @@ -13068,7 +13068,7 @@ def timestamp_diff(unit: str, start: "ColumnOrName", end: "ColumnOrName") -> Col @_try_remote_functions def timestamp_add(unit: str, quantity: "ColumnOrName", ts: "ColumnOrName") -> Column: """ - Adds the specified number of units to the given timestamp. + Adds the specified number of units to the given timestamp .. versionadded:: 4.0.0 From 693b3de1895ef233b5f5d2dfdb0731b08d68b085 Mon Sep 17 00:00:00 2001 From: judy <1169859401@qq.com> Date: Fri, 13 Mar 2026 17:55:04 -0700 Subject: [PATCH 3/5] CI again --- python/pyspark/sql/functions/builtin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pyspark/sql/functions/builtin.py b/python/pyspark/sql/functions/builtin.py index c543fa5207dee..b04e484bfb5ba 100644 --- a/python/pyspark/sql/functions/builtin.py +++ b/python/pyspark/sql/functions/builtin.py @@ -13070,7 +13070,7 @@ def timestamp_add(unit: str, quantity: "ColumnOrName", ts: "ColumnOrName") -> Co """ Adds the specified number of units to the given timestamp - .. versionadded:: 4.0.0 + versionadded:: 4.0.0 Parameters ---------- From 0949f76a5f690dbb13d1e8e8b4c79b7c9761bd19 Mon Sep 17 00:00:00 2001 From: judy <1169859401@qq.com> Date: Sun, 15 Mar 2026 19:55:23 -0700 Subject: [PATCH 4/5] add .. --- python/pyspark/sql/functions/builtin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pyspark/sql/functions/builtin.py b/python/pyspark/sql/functions/builtin.py index b04e484bfb5ba..74624e079a71d 100644 --- a/python/pyspark/sql/functions/builtin.py +++ b/python/pyspark/sql/functions/builtin.py @@ -13070,7 +13070,7 @@ def timestamp_add(unit: str, quantity: "ColumnOrName", ts: "ColumnOrName") -> Co """ Adds the specified number of units to the given timestamp - versionadded:: 4.0.0 + ..versionadded:: 4.0.0 Parameters ---------- From 13ed9f9341a8ef93b3b7cc1def754bb46b156209 Mon Sep 17 00:00:00 2001 From: Hyukjin Kwon Date: Mon, 16 Mar 2026 12:44:48 +0900 Subject: [PATCH 5/5] Apply suggestion from @HyukjinKwon --- python/pyspark/sql/functions/builtin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pyspark/sql/functions/builtin.py b/python/pyspark/sql/functions/builtin.py index 74624e079a71d..c543fa5207dee 100644 --- a/python/pyspark/sql/functions/builtin.py +++ b/python/pyspark/sql/functions/builtin.py @@ -13070,7 +13070,7 @@ def timestamp_add(unit: str, quantity: "ColumnOrName", ts: "ColumnOrName") -> Co """ Adds the specified number of units to the given timestamp - ..versionadded:: 4.0.0 + .. versionadded:: 4.0.0 Parameters ----------