Skip to content

Commit e955d47

Browse files
author
Matt Roeschke
committed
Merge branch 'feature/generalized_window_operations' into feature/rolling_apply_numba
2 parents 1bcc83e + c7eb6f2 commit e955d47

File tree

7 files changed

+10
-13
lines changed

7 files changed

+10
-13
lines changed

ci/deps/travis-36-cov.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dependencies:
2929
- python-snappy
3030
- python=3.6.*
3131
- pytz
32-
- s3fs
32+
- s3fs<0.3
3333
- scikit-learn
3434
- scipy
3535
- sqlalchemy

ci/deps/travis-36-slow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies:
1818
- python-dateutil
1919
- python=3.6.*
2020
- pytz
21-
- s3fs
21+
- s3fs<0.3
2222
- scipy
2323
- sqlalchemy
2424
- xlrd

ci/deps/travis-37.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies:
1717
- pytest-xdist>=1.29.0
1818
- pytest-mock
1919
- hypothesis>=3.58.0
20-
- s3fs
20+
- s3fs<0.3
2121
- pip
2222
- pyreadstat
2323
- pip:

doc/source/whatsnew/v1.0.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ Reshaping
279279

280280
- Bug in :meth:`DataFrame.apply` that caused incorrect output with empty :class:`DataFrame` (:issue:`28202`, :issue:`21959`)
281281
- Bug in :meth:`DataFrame.stack` not handling non-unique indexes correctly when creating MultiIndex (:issue: `28301`)
282+
- Bug :func:`merge_asof` could not use :class:`datetime.timedelta` for ``tolerance`` kwarg (:issue:`28098`)
282283

283284
Sparse
284285
^^^^^^

pandas/core/reshape/merge.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44

55
import copy
6+
import datetime
67
from functools import partial
78
import string
89
import warnings
@@ -1619,7 +1620,7 @@ def _get_merge_keys(self):
16191620
)
16201621
raise MergeError(msg)
16211622

1622-
# validate tolerance; must be a Timedelta if we have a DTI
1623+
# validate tolerance; datetime.timedelta or Timedelta if we have a DTI
16231624
if self.tolerance is not None:
16241625

16251626
if self.left_index:
@@ -1635,7 +1636,7 @@ def _get_merge_keys(self):
16351636
)
16361637

16371638
if is_datetimelike(lt):
1638-
if not isinstance(self.tolerance, Timedelta):
1639+
if not isinstance(self.tolerance, datetime.timedelta):
16391640
raise MergeError(msg)
16401641
if self.tolerance < Timedelta(0):
16411642
raise MergeError("tolerance must be positive")
@@ -1705,6 +1706,7 @@ def flip(xs):
17051706
left_values = left_values.view("i8")
17061707
right_values = right_values.view("i8")
17071708
if tolerance is not None:
1709+
tolerance = Timedelta(tolerance)
17081710
tolerance = tolerance.value
17091711

17101712
# a "by" parameter requires special handling

pandas/tests/groupby/test_categorical.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ def test_categorical_no_compress():
782782

783783
def test_sort():
784784

785-
# http://stackoverflow.com/questions/23814368/sorting-pandas-categorical-labels-after-groupby # noqa: flake8
785+
# http://stackoverflow.com/questions/23814368/sorting-pandas-categorical-labels-after-groupby # noqa: E501
786786
# This should result in a properly sorted Series so that the plot
787787
# has a sorted x axis
788788
# self.cat.groupby(['value_group'])['value_group'].count().plot(kind='bar')

pandas/tests/reshape/merge/test_merge_asof.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -592,13 +592,7 @@ def test_non_sorted(self):
592592

593593
@pytest.mark.parametrize(
594594
"tolerance",
595-
[
596-
Timedelta("1day"),
597-
pytest.param(
598-
datetime.timedelta(days=1),
599-
marks=pytest.mark.xfail(reason="not implemented", strict=True),
600-
),
601-
],
595+
[Timedelta("1day"), datetime.timedelta(days=1)],
602596
ids=["pd.Timedelta", "datetime.timedelta"],
603597
)
604598
def test_tolerance(self, tolerance):

0 commit comments

Comments
 (0)