Skip to content

Commit 1597220

Browse files
committed
fixup
1 parent 8c7357f commit 1597220

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

pandas/core/reshape/tile.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,10 @@ def _convert_bin_to_datelike_type(bins, dtype):
449449
bins : Array-like of bins, DatetimeIndex or TimedeltaIndex if dtype is
450450
datelike
451451
"""
452-
if is_datetime64tz_dtype(dtype) or is_datetime_or_timedelta_dtype(dtype):
452+
if is_datetime64tz_dtype(dtype):
453+
bins = to_datetime(bins.astype(np.int64),
454+
utc=True).tz_convert(dtype.tz)
455+
elif is_datetime_or_timedelta_dtype(dtype):
453456
bins = Index(bins.astype(np.int64), dtype=dtype)
454457
return bins
455458

pandas/tests/resample/test_period_index.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,10 @@ def test_resample_weekly_bug_1726(self):
517517

518518
def test_resample_with_dst_time_change(self):
519519
# GH 15549
520-
index = pd.DatetimeIndex([1457537600000000000, 1458059600000000000],
521-
tz='UTC').tz_convert('America/Chicago')
520+
index = (
521+
pd.DatetimeIndex([1457537600000000000, 1458059600000000000])
522+
.tz_localize("UTC").tz_convert('America/Chicago')
523+
)
522524
df = pd.DataFrame([1, 2], index=index)
523525
result = df.resample('12h', closed='right',
524526
label='right').last().ffill()

pandas/tests/test_base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,7 @@ class TestToIterable(object):
10371037
lambda x: list(x.__iter__()),
10381038
], ids=['tolist', 'to_list', 'list', 'iter'])
10391039
@pytest.mark.parametrize('typ', [Series, Index])
1040+
@pytest.mark.filterwarnings("ignore::FutureWarning")
10401041
def test_iterable(self, typ, method, dtype, rdtype):
10411042
# gh-10904
10421043
# gh-13258

0 commit comments

Comments
 (0)