This is an automated email from the ASF dual-hosted git repository.
gurwls223 pushed a commit to branch branch-3.5
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.5 by this push:
new c0a4416cb960 [SPARK-47202][PYTHON] Fix typo breaking datetimes with
tzinfo
c0a4416cb960 is described below
commit c0a4416cb960b1a8c335d1c0c27ceeccfacdb377
Author: Arzav Jain <[email protected]>
AuthorDate: Wed Feb 28 14:10:32 2024 +0900
[SPARK-47202][PYTHON] Fix typo breaking datetimes with tzinfo
This PR fixes a bug caused due to a typo.
This bug is preventing users from having datetime.datetime objects with
tzinfo when using the `TimestampType`
No, just a bug fix.
There ought to be CI that lints code and catches these simple errors at the
time of opening the PR.
No
Closes #45301 from arzavj/SPARK-47202.
Authored-by: Arzav Jain <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
(cherry picked from commit bf8396eaef9f95de3dab712e8895e4bc63adef7c)
Signed-off-by: Hyukjin Kwon <[email protected]>
---
python/pyspark/sql/pandas/types.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/python/pyspark/sql/pandas/types.py
b/python/pyspark/sql/pandas/types.py
index b02a003e632c..9b7c40ddb24e 100644
--- a/python/pyspark/sql/pandas/types.py
+++ b/python/pyspark/sql/pandas/types.py
@@ -898,7 +898,7 @@ def _create_converter_from_pandas(
return None
else:
if isinstance(value, datetime.datetime) and value.tzinfo
is not None:
- ts = pd.Timstamp(value)
+ ts = pd.Timestamp(value)
else:
ts = pd.Timestamp(value).tz_localize(timezone)
return ts.to_pydatetime()
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]