This is an automated email from the ASF dual-hosted git repository. gurwls223 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 bf8396eaef9f [SPARK-47202][PYTHON] Fix typo breaking datetimes with tzinfo bf8396eaef9f is described below commit bf8396eaef9f95de3dab712e8895e4bc63adef7c Author: Arzav Jain <arz...@users.noreply.github.com> AuthorDate: Wed Feb 28 14:10:32 2024 +0900 [SPARK-47202][PYTHON] Fix typo breaking datetimes with tzinfo ### What changes were proposed in this pull request? This PR fixes a bug caused due to a typo. ### Why are the changes needed? This bug is preventing users from having datetime.datetime objects with tzinfo when using the `TimestampType` ### Does this PR introduce _any_ user-facing change? No, just a bug fix. ### How was this patch tested? There ought to be CI that lints code and catches these simple errors at the time of opening the PR. ### Was this patch authored or co-authored using generative AI tooling? No Closes #45301 from arzavj/SPARK-47202. Authored-by: Arzav Jain <arz...@users.noreply.github.com> Signed-off-by: Hyukjin Kwon <gurwls...@apache.org> --- 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 674dee5ca25f..3b48f8d8c319 100644 --- a/python/pyspark/sql/pandas/types.py +++ b/python/pyspark/sql/pandas/types.py @@ -993,7 +993,7 @@ def _create_converter_from_pandas( def convert_timestamp(value: Any) -> Any: 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: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org