Skip to content
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

Fix test_multi_index_two_way_query FailedHealthCheck #2160

Merged
merged 1 commit into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
9 changes: 0 additions & 9 deletions tiledb/tests/strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@
# (custom strategies, etc.)


@composite
def bounded_ntuple(draw, *, length=1, min_value=0, max_value=10):
"""hypothesis composite strategy that returns a `length` tuple of integers
within the range (min_value, max_value)
"""

return draw(st.tuples(*[st.integers(min_value, max_value) for _ in range(length)]))


@composite
def ranged_slices(draw, min_value=0, max_value=10):
bdd = st.one_of(st.none(), st.integers(min_value=min_value, max_value=max_value))
Expand Down
10 changes: 7 additions & 3 deletions tiledb/tests/test_multi_index-hp.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import tiledb
from tiledb import SparseArray

from .strategies import bounded_ntuple, ranged_slices
from .strategies import ranged_slices


def is_boundserror(exc: Exception):
Expand Down Expand Up @@ -89,7 +89,12 @@ def create_array(uri):

@given(
order=st.sampled_from(["C", "F", "U"]),
ranges=st.lists(bounded_ntuple(length=2, min_value=-100, max_value=100)),
ranges=st.lists(
st.tuples(
st.integers(min_value=-100, max_value=100),
st.integers(min_value=-100, max_value=100),
).map(lambda x: (min(x), max(x)))
),
)
@hp.settings(deadline=None)
def test_multi_index_two_way_query(self, order, ranges, sparse_array_1d):
Expand All @@ -98,7 +103,6 @@ def test_multi_index_two_way_query(self, order, ranges, sparse_array_1d):
uri = sparse_array_1d

assert isinstance(uri, str)
assume(v[0] <= v[1] for v in ranges)

try:
with tiledb.open(uri) as A:
Expand Down
Loading