Skip to content

Commit f54c151

Browse files
author
harisbal
committed
Merge remote-tracking branch 'upstream/master' into multi-index-join
2 parents 06d48d0 + 24ab22f commit f54c151

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

doc/source/conf.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,11 @@ def linkcode_resolve(domain, info):
569569
return None
570570

571571
try:
572-
fn = inspect.getsourcefile(obj)
572+
# inspect.unwrap() was added in Python version 3.4
573+
if sys.version_info >= (3, 5):
574+
fn = inspect.getsourcefile(inspect.unwrap(obj))
575+
else:
576+
fn = inspect.getsourcefile(obj)
573577
except:
574578
fn = None
575579
if not fn:

doc/source/whatsnew/v0.24.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1239,6 +1239,7 @@ Indexing
12391239
- The traceback from a ``KeyError`` when asking ``.loc`` for a single missing label is now shorter and more clear (:issue:`21557`)
12401240
- When ``.ix`` is asked for a missing integer label in a :class:`MultiIndex` with a first level of integer type, it now raises a ``KeyError``, consistently with the case of a flat :class:`Int64Index`, rather than falling back to positional indexing (:issue:`21593`)
12411241
- Bug in :meth:`DatetimeIndex.reindex` when reindexing a tz-naive and tz-aware :class:`DatetimeIndex` (:issue:`8306`)
1242+
- Bug in :meth:`Series.reindex` when reindexing an empty series with a ``datetime64[ns, tz]`` dtype (:issue:`20869`)
12421243
- Bug in :class:`DataFrame` when setting values with ``.loc`` and a timezone aware :class:`DatetimeIndex` (:issue:`11365`)
12431244
- ``DataFrame.__getitem__`` now accepts dictionaries and dictionary keys as list-likes of labels, consistently with ``Series.__getitem__`` (:issue:`21294`)
12441245
- Fixed ``DataFrame[np.nan]`` when columns are non-unique (:issue:`21428`)

pandas/tests/series/indexing/test_alter_index.py

+7
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,13 @@ def test_reindex_datetimeindexes_tz_naive_and_aware():
459459
s.reindex(newidx, method='ffill')
460460

461461

462+
def test_reindex_empty_series_tz_dtype():
463+
# GH 20869
464+
result = Series(dtype='datetime64[ns, UTC]').reindex([0, 1])
465+
expected = Series([pd.NaT] * 2, dtype='datetime64[ns, UTC]')
466+
tm.assert_equal(result, expected)
467+
468+
462469
def test_rename():
463470
# GH 17407
464471
s = Series(range(1, 6), index=pd.Index(range(2, 7), name='IntIndex'))

0 commit comments

Comments
 (0)