@@ -310,7 +310,7 @@ def _convert_listlike(arg, box, format, name=None, tz=tz):
310310 except (ValueError , TypeError ):
311311 raise e
312312
313- def _maybe_convert_cache (arg , cache ):
313+ def _maybe_convert_cache (arg , cache , tz ):
314314 """Try to convert the datetimelike arg using
315315 a cache of converted dates.
316316
@@ -325,7 +325,8 @@ def _maybe_convert_cache(arg, cache):
325325 unique_dates = algorithms .unique (arg )
326326 if len (unique_dates ) != len (arg ):
327327 from pandas import Series
328- cache_dates = _convert_listlike (unique_dates , False , format )
328+ cache_dates = _convert_listlike (unique_dates , True , format ,
329+ tz = tz )
329330 convert_cache = Series (cache_dates , index = unique_dates )
330331 if not isinstance (arg , Series ):
331332 arg = Series (arg )
@@ -396,23 +397,23 @@ def _maybe_convert_cache(arg, cache):
396397 if isinstance (arg , tslib .Timestamp ):
397398 result = arg
398399 elif isinstance (arg , ABCSeries ):
399- result = _maybe_convert_cache (arg , cache )
400+ result = _maybe_convert_cache (arg , cache , tz )
400401 if result is None :
401402 from pandas import Series
402403 values = _convert_listlike (arg ._values , True , format )
403404 result = Series (values , index = arg .index , name = arg .name )
404405 elif isinstance (arg , (ABCDataFrame , MutableMapping )):
405406 result = _assemble_from_unit_mappings (arg , errors = errors )
406407 elif isinstance (arg , ABCIndexClass ):
407- result = _maybe_convert_cache (arg , cache )
408+ result = _maybe_convert_cache (arg , cache , tz )
408409 if result is None :
409410 result = _convert_listlike (arg , box , format , name = arg .name )
410411 else :
411412 result = result .values
412413 if box :
413414 result = DatetimeIndex (result , tz = tz , name = arg .name )
414415 elif is_list_like (arg ):
415- result = _maybe_convert_cache (arg , cache )
416+ result = _maybe_convert_cache (arg , cache , tz )
416417 if result is None :
417418 result = _convert_listlike (arg , box , format )
418419 else :
0 commit comments