You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by felixcheung <gi...@git.apache.org> on 2018/03/01 05:29:57 UTC

[GitHub] spark pull request #20295: [SPARK-23011] Support alternative function form w...

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: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org