@@ -29,9 +29,11 @@ def is_boundserror(exc: Exception):
29
29
return any (x in str (exc ) for x in vals )
30
30
31
31
32
- def _direct_query_ranges (array : SparseArray , ranges ):
32
+ def _direct_query_ranges (array : SparseArray , ranges , order ):
33
+ order_map = {"C" : 0 , "F" : 1 , "U" : 3 }
34
+ layout = order_map [order ]
33
35
with tiledb .scope_ctx () as ctx :
34
- q = tiledb .main .PyQuery (ctx , array , ("a" ,), (), 0 , False )
36
+ q = tiledb .main .PyQuery (ctx , array , ("a" ,), (), layout , False )
35
37
q .set_ranges (ranges )
36
38
q .submit ()
37
39
return {k : v [0 ].view (array .attr (0 ).dtype ) for k , v in q .results ().items ()}
@@ -77,8 +79,9 @@ def create_array(uri):
77
79
78
80
return uri
79
81
82
+ @pytest .mark .parametrize ("order" , ["C" , "F" , "U" ])
80
83
@given (st .lists (bounded_ntuple (length = 2 , min_value = - 100 , max_value = 100 )))
81
- def test_multi_index_two_way_query (self , sparse_array_1d , ranges ):
84
+ def test_multi_index_two_way_query (self , order , sparse_array_1d , ranges ):
82
85
"""This test checks the result of "direct" range queries using PyQuery
83
86
against the result of `multi_index` on the same ranges."""
84
87
@@ -89,8 +92,8 @@ def test_multi_index_two_way_query(self, sparse_array_1d, ranges):
89
92
90
93
try :
91
94
with tiledb .open (uri ) as A :
92
- r1 = A .multi_index [ranges ]["a" ]
93
- r2 = _direct_query_ranges (A , [ranges ])["a" ]
95
+ r1 = A .query ( order = order ). multi_index [ranges ]["a" ]
96
+ r2 = _direct_query_ranges (A , [ranges ], order )["a" ]
94
97
95
98
assert_array_equal (r1 , r2 )
96
99
except tiledb .TileDBError as exc :
0 commit comments