Skip to content

Commit 20d96e0

Browse files
author
Adrian
committed
BUG: Series.ffill() with mixed dtypes containing tz-aware datetimes fails. (GH14956)
1 parent 3e4f839 commit 20d96e0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

doc/source/whatsnew/v0.20.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -300,3 +300,4 @@ Bug Fixes
300300
- Bug in ``Series.unique()`` in which unsigned 64-bit integers were causing overflow (:issue:`14721`)
301301
- Require at least 0.23 version of cython to avoid problems with character encodings (:issue:`14699`)
302302
- Bug in converting object elements of array-like objects to unsigned 64-bit integers (:issue:`4471`)
303+
- Bug in Series.ffill() with mixed dtypes containing tz-aware datetimes. (:issue: `14956`)

pandas/src/inference.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ def maybe_convert_objects(ndarray[object] objects, bint try_float=0,
859859

860860
# we try to coerce datetime w/tz but must all have the same tz
861861
if seen_datetimetz:
862-
if len(set([ getattr(val, 'tz', None) for val in objects ])) == 1:
862+
if len(set([getattr(val, 'tzinfo', None) for val in objects])) == 1:
863863
from pandas import DatetimeIndex
864864
return DatetimeIndex(objects)
865865
seen_object = 1

0 commit comments

Comments
 (0)