viirya commented on a change in pull request #33876:
URL: https://github.com/apache/spark/pull/33876#discussion_r700473408



##########
File path: python/pyspark/sql/pandas/conversion.py
##########
@@ -369,7 +373,10 @@ def _convert_from_pandas(self, pdf, schema, timezone):
                             pdf[field.name] = s
             else:
                 for column, series in pdf.iteritems():
-                    s = _check_series_convert_timestamps_tz_local(series, 
timezone)
+                    s = series
+                    should_localize = not self._is_timestamp_ntz_preferred()
+                    if should_localize and is_datetime64tz_dtype(s.dtype) and 
s.dt.tz is not None:

Review comment:
       Seems we already handle for `is_datetime64tz_dtype` in 
`_check_series_convert_timestamps_tz_local`? For non `is_datetime64tz_dtype` 
case we skip localization? Is it different to previous?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to