Github user felixcheung commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20295#discussion_r171466325
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -1725,6 +1737,29 @@ def _get_local_timezone():
         return os.environ.get('TZ', 'dateutil/:')
     
     
    +def _check_series_localize_timestamps(s, timezone):
    +    """
    +    Convert timezone aware timestamps to timezone-naive in the specified 
timezone or local timezone.
    +
    +    If the input series is not a timestamp series, then the same series is 
returned. If the input
    +    series is a timestamp series, then a converted series is returned.
    +
    +    :param s: pandas.Series
    +    :param timezone: the timezone to convert. if None then use local 
timezone
    +    :return pandas.Series that have been converted to tz-naive
    +    """
    +    from pyspark.sql.utils import require_minimum_pandas_version
    +    require_minimum_pandas_version()
    +
    +    from pandas.api.types import is_datetime64tz_dtype
    --- End diff --
    
    do we have tests for tese in tests.py?


---

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

Reply via email to