@@ -1729,28 +1729,28 @@ def _check_series_convert_timestamps_internal(s, timezone):
17291729 return s
17301730
17311731
1732- def _check_series_convert_timestamps_localize (s , fromTimezone , toTimezone ):
1732+ def _check_series_convert_timestamps_localize (s , from_timezone , to_timezone ):
17331733 """
17341734 Convert timestamp to timezone-naive in the specified timezone or local timezone
17351735
17361736 :param s: a pandas.Series
1737- :param fromTimezone : the timezone to convert from. if None then use local timezone
1738- :param toTimezone : the timezone to convert to. if None then use local timezone
1737+ :param from_timezone : the timezone to convert from. if None then use local timezone
1738+ :param to_timezone : the timezone to convert to. if None then use local timezone
17391739 :return pandas.Series where if it is a timestamp, has been converted to tz-naive
17401740 """
17411741 try :
17421742 import pandas as pd
17431743 from pandas .api .types import is_datetime64tz_dtype , is_datetime64_dtype
17441744 except ImportError as e :
17451745 raise ImportError (_old_pandas_exception_message (e ))
1746- fromTz = fromTimezone or 'tzlocal()'
1747- toTz = toTimezone or 'tzlocal()'
1746+ from_tz = from_timezone or 'tzlocal()'
1747+ to_tz = to_timezone or 'tzlocal()'
17481748 # TODO: handle nested timestamps, such as ArrayType(TimestampType())?
17491749 if is_datetime64tz_dtype (s .dtype ):
1750- return s .dt .tz_convert (toTz ).dt .tz_localize (None )
1751- elif is_datetime64_dtype (s .dtype ) and fromTz != toTz :
1750+ return s .dt .tz_convert (to_tz ).dt .tz_localize (None )
1751+ elif is_datetime64_dtype (s .dtype ) and from_tz != to_tz :
17521752 # `s.dt.tz_localize('tzlocal()')` doesn't work properly when including NaT.
1753- return s .apply (lambda ts : ts .tz_localize (fromTz ).tz_convert (toTz ).tz_localize (None )
1753+ return s .apply (lambda ts : ts .tz_localize (from_tz ).tz_convert (to_tz ).tz_localize (None )
17541754 if ts is not pd .NaT else pd .NaT )
17551755 else :
17561756 return s
0 commit comments