Skip to content

Fix mypy error in pandas\tests\indexes\interval\test_interval_tree.py #29021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 7, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pandas/tests/indexes/interval/test_interval_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,20 @@ def test_get_indexer_closed(self, closed, leaf_size):
(np.array([0, 2, np.nan]), np.array([1, 3, np.nan]), False),
],
)
@pytest.mark.parametrize("order", map(list, permutations(range(3))))
# https://github.com/python/mypy/issues/6697
# error: Argument 1 to "map" has incompatible type "Type[List[Any]]";
# expected "Callable[[Tuple[int, ...]], List[_T]]"
@pytest.mark.parametrize("order", map(list, permutations(range(3)))) # type: ignore
def test_is_overlapping(self, closed, order, left, right, expected):
# GH 23309
tree = IntervalTree(left[order], right[order], closed=closed)
result = tree.is_overlapping
assert result is expected

@pytest.mark.parametrize("order", map(list, permutations(range(3))))
# https://github.com/python/mypy/issues/6697
# error: Argument 1 to "map" has incompatible type "Type[List[Any]]";
# expected "Callable[[Tuple[int, ...]], List[_T]]"
@pytest.mark.parametrize("order", map(list, permutations(range(3)))) # type: ignore
def test_is_overlapping_endpoints(self, closed, order):
"""shared endpoints are marked as overlapping"""
# GH 23309
Expand Down
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,6 @@ ignore_errors=True
[mypy-pandas.tests.indexes.interval.test_base]
ignore_errors=True

[mypy-pandas.tests.indexes.interval.test_interval_tree]
ignore_errors=True

[mypy-pandas.tests.indexes.period.test_period]
ignore_errors=True

Expand Down