@@ -16,7 +16,7 @@ def intlist(obj):
16
16
return [int (v ) for v in obj ]
17
17
18
18
19
- async def test_create (decoded_r : valkey .Valkey ):
19
+ async def test_create (decoded_r : valkey .Valkey [ str ] ):
20
20
"""Test CREATE/RESERVE calls"""
21
21
assert await decoded_r .bf ().create ("bloom" , 0.01 , 1000 )
22
22
assert await decoded_r .bf ().create ("bloom_e" , 0.01 , 1000 , expansion = 1 )
@@ -31,11 +31,11 @@ async def test_create(decoded_r: valkey.Valkey):
31
31
32
32
33
33
@pytest .mark .experimental
34
- async def test_tdigest_create (decoded_r : valkey .Valkey ):
34
+ async def test_tdigest_create (decoded_r : valkey .Valkey [ str ] ):
35
35
assert await decoded_r .tdigest ().create ("tDigest" , 100 )
36
36
37
37
38
- async def test_bf_add (decoded_r : valkey .Valkey ):
38
+ async def test_bf_add (decoded_r : valkey .Valkey [ str ] ):
39
39
assert await decoded_r .bf ().create ("bloom" , 0.01 , 1000 )
40
40
assert 1 == await decoded_r .bf ().add ("bloom" , "foo" )
41
41
assert 0 == await decoded_r .bf ().add ("bloom" , "foo" )
@@ -47,7 +47,7 @@ async def test_bf_add(decoded_r: valkey.Valkey):
47
47
assert [1 , 0 ] == intlist (await decoded_r .bf ().mexists ("bloom" , "foo" , "noexist" ))
48
48
49
49
50
- async def test_bf_insert (decoded_r : valkey .Valkey ):
50
+ async def test_bf_insert (decoded_r : valkey .Valkey [ str ] ):
51
51
assert await decoded_r .bf ().create ("bloom" , 0.01 , 1000 )
52
52
assert [1 ] == intlist (await decoded_r .bf ().insert ("bloom" , ["foo" ]))
53
53
assert [0 , 1 ] == intlist (await decoded_r .bf ().insert ("bloom" , ["foo" , "bar" ]))
@@ -77,7 +77,7 @@ async def test_bf_insert(decoded_r: valkey.Valkey):
77
77
)
78
78
79
79
80
- async def test_bf_scandump_and_loadchunk (decoded_r : valkey .Valkey ):
80
+ async def test_bf_scandump_and_loadchunk (decoded_r : valkey .Valkey [ str ] ):
81
81
# Store a filter
82
82
await decoded_r .bf ().create ("myBloom" , "0.0001" , "1000" )
83
83
@@ -124,7 +124,7 @@ async def do_verify():
124
124
await decoded_r .bf ().create ("myBloom" , "0.0001" , "10000000" )
125
125
126
126
127
- async def test_bf_info (decoded_r : valkey .Valkey ):
127
+ async def test_bf_info (decoded_r : valkey .Valkey [ str ] ):
128
128
expansion = 4
129
129
# Store a filter
130
130
await decoded_r .bf ().create ("nonscaling" , "0.0001" , "1000" , noScale = True )
@@ -155,7 +155,7 @@ async def test_bf_info(decoded_r: valkey.Valkey):
155
155
assert True
156
156
157
157
158
- async def test_bf_card (decoded_r : valkey .Valkey ):
158
+ async def test_bf_card (decoded_r : valkey .Valkey [ str ] ):
159
159
# return 0 if the key does not exist
160
160
assert await decoded_r .bf ().card ("not_exist" ) == 0
161
161
@@ -169,7 +169,7 @@ async def test_bf_card(decoded_r: valkey.Valkey):
169
169
await decoded_r .bf ().card ("setKey" )
170
170
171
171
172
- async def test_cf_add_and_insert (decoded_r : valkey .Valkey ):
172
+ async def test_cf_add_and_insert (decoded_r : valkey .Valkey [ str ] ):
173
173
assert await decoded_r .cf ().create ("cuckoo" , 1000 )
174
174
assert await decoded_r .cf ().add ("cuckoo" , "filter" )
175
175
assert not await decoded_r .cf ().addnx ("cuckoo" , "filter" )
@@ -194,7 +194,7 @@ async def test_cf_add_and_insert(decoded_r: valkey.Valkey):
194
194
)
195
195
196
196
197
- async def test_cf_exists_and_del (decoded_r : valkey .Valkey ):
197
+ async def test_cf_exists_and_del (decoded_r : valkey .Valkey [ str ] ):
198
198
assert await decoded_r .cf ().create ("cuckoo" , 1000 )
199
199
assert await decoded_r .cf ().add ("cuckoo" , "filter" )
200
200
assert await decoded_r .cf ().exists ("cuckoo" , "filter" )
@@ -205,7 +205,7 @@ async def test_cf_exists_and_del(decoded_r: valkey.Valkey):
205
205
assert 0 == await decoded_r .cf ().count ("cuckoo" , "filter" )
206
206
207
207
208
- async def test_cms (decoded_r : valkey .Valkey ):
208
+ async def test_cms (decoded_r : valkey .Valkey [ str ] ):
209
209
assert await decoded_r .cms ().initbydim ("dim" , 1000 , 5 )
210
210
assert await decoded_r .cms ().initbyprob ("prob" , 0.01 , 0.01 )
211
211
assert await decoded_r .cms ().incrby ("dim" , ["foo" ], [5 ])
@@ -221,7 +221,7 @@ async def test_cms(decoded_r: valkey.Valkey):
221
221
222
222
223
223
@pytest .mark .onlynoncluster
224
- async def test_cms_merge (decoded_r : valkey .Valkey ):
224
+ async def test_cms_merge (decoded_r : valkey .Valkey [ str ] ):
225
225
assert await decoded_r .cms ().initbydim ("A" , 1000 , 5 )
226
226
assert await decoded_r .cms ().initbydim ("B" , 1000 , 5 )
227
227
assert await decoded_r .cms ().initbydim ("C" , 1000 , 5 )
@@ -237,7 +237,7 @@ async def test_cms_merge(decoded_r: valkey.Valkey):
237
237
assert [16 , 15 , 21 ] == await decoded_r .cms ().query ("C" , "foo" , "bar" , "baz" )
238
238
239
239
240
- async def test_topk (decoded_r : valkey .Valkey ):
240
+ async def test_topk (decoded_r : valkey .Valkey [ str ] ):
241
241
# test list with empty buckets
242
242
assert await decoded_r .topk ().reserve ("topk" , 3 , 50 , 4 , 0.9 )
243
243
assert [
@@ -317,7 +317,7 @@ async def test_topk(decoded_r: valkey.Valkey):
317
317
assert 0.9 == round (float (info ["decay" ]), 1 )
318
318
319
319
320
- async def test_topk_incrby (decoded_r : valkey .Valkey ):
320
+ async def test_topk_incrby (decoded_r : valkey .Valkey [ str ] ):
321
321
await decoded_r .flushdb ()
322
322
assert await decoded_r .topk ().reserve ("topk" , 3 , 10 , 3 , 1 )
323
323
assert [None , None , None ] == await decoded_r .topk ().incrby (
@@ -332,7 +332,7 @@ async def test_topk_incrby(decoded_r: valkey.Valkey):
332
332
333
333
334
334
@pytest .mark .experimental
335
- async def test_tdigest_reset (decoded_r : valkey .Valkey ):
335
+ async def test_tdigest_reset (decoded_r : valkey .Valkey [ str ] ):
336
336
assert await decoded_r .tdigest ().create ("tDigest" , 10 )
337
337
# reset on empty histogram
338
338
assert await decoded_r .tdigest ().reset ("tDigest" )
@@ -348,7 +348,7 @@ async def test_tdigest_reset(decoded_r: valkey.Valkey):
348
348
349
349
350
350
@pytest .mark .onlynoncluster
351
- async def test_tdigest_merge (decoded_r : valkey .Valkey ):
351
+ async def test_tdigest_merge (decoded_r : valkey .Valkey [ str ] ):
352
352
assert await decoded_r .tdigest ().create ("to-tDigest" , 10 )
353
353
assert await decoded_r .tdigest ().create ("from-tDigest" , 10 )
354
354
# insert data-points into sketch
@@ -375,7 +375,7 @@ async def test_tdigest_merge(decoded_r: valkey.Valkey):
375
375
376
376
377
377
@pytest .mark .experimental
378
- async def test_tdigest_min_and_max (decoded_r : valkey .Valkey ):
378
+ async def test_tdigest_min_and_max (decoded_r : valkey .Valkey [ str ] ):
379
379
assert await decoded_r .tdigest ().create ("tDigest" , 100 )
380
380
# insert data-points into sketch
381
381
assert await decoded_r .tdigest ().add ("tDigest" , [1 , 2 , 3 ])
@@ -385,8 +385,8 @@ async def test_tdigest_min_and_max(decoded_r: valkey.Valkey):
385
385
386
386
387
387
@pytest .mark .experimental
388
- @skip_ifmodversion_lt ("2.4.0" , "bf" )
389
- async def test_tdigest_quantile (decoded_r : valkey .Valkey ):
388
+ @skip_ifmodversion_lt ("2.4.0" , "bf" ) # type: ignore[misc]
389
+ async def test_tdigest_quantile (decoded_r : valkey .Valkey [ str ] ):
390
390
assert await decoded_r .tdigest ().create ("tDigest" , 500 )
391
391
# insert data-points into sketch
392
392
assert await decoded_r .tdigest ().add (
@@ -413,7 +413,7 @@ async def test_tdigest_quantile(decoded_r: valkey.Valkey):
413
413
414
414
415
415
@pytest .mark .experimental
416
- async def test_tdigest_cdf (decoded_r : valkey .Valkey ):
416
+ async def test_tdigest_cdf (decoded_r : valkey .Valkey [ str ] ):
417
417
assert await decoded_r .tdigest ().create ("tDigest" , 100 )
418
418
# insert data-points into sketch
419
419
assert await decoded_r .tdigest ().add ("tDigest" , list (range (1 , 10 )))
@@ -424,8 +424,8 @@ async def test_tdigest_cdf(decoded_r: valkey.Valkey):
424
424
425
425
426
426
@pytest .mark .experimental
427
- @skip_ifmodversion_lt ("2.4.0" , "bf" )
428
- async def test_tdigest_trimmed_mean (decoded_r : valkey .Valkey ):
427
+ @skip_ifmodversion_lt ("2.4.0" , "bf" ) # type: ignore[misc]
428
+ async def test_tdigest_trimmed_mean (decoded_r : valkey .Valkey [ str ] ):
429
429
assert await decoded_r .tdigest ().create ("tDigest" , 100 )
430
430
# insert data-points into sketch
431
431
assert await decoded_r .tdigest ().add ("tDigest" , list (range (1 , 10 )))
@@ -434,7 +434,7 @@ async def test_tdigest_trimmed_mean(decoded_r: valkey.Valkey):
434
434
435
435
436
436
@pytest .mark .experimental
437
- async def test_tdigest_rank (decoded_r : valkey .Valkey ):
437
+ async def test_tdigest_rank (decoded_r : valkey .Valkey [ str ] ):
438
438
assert await decoded_r .tdigest ().create ("t-digest" , 500 )
439
439
assert await decoded_r .tdigest ().add ("t-digest" , list (range (0 , 20 )))
440
440
assert - 1 == (await decoded_r .tdigest ().rank ("t-digest" , - 1 ))[0 ]
@@ -444,7 +444,7 @@ async def test_tdigest_rank(decoded_r: valkey.Valkey):
444
444
445
445
446
446
@pytest .mark .experimental
447
- async def test_tdigest_revrank (decoded_r : valkey .Valkey ):
447
+ async def test_tdigest_revrank (decoded_r : valkey .Valkey [ str ] ):
448
448
assert await decoded_r .tdigest ().create ("t-digest" , 500 )
449
449
assert await decoded_r .tdigest ().add ("t-digest" , list (range (0 , 20 )))
450
450
assert - 1 == (await decoded_r .tdigest ().revrank ("t-digest" , 20 ))[0 ]
@@ -453,7 +453,7 @@ async def test_tdigest_revrank(decoded_r: valkey.Valkey):
453
453
454
454
455
455
@pytest .mark .experimental
456
- async def test_tdigest_byrank (decoded_r : valkey .Valkey ):
456
+ async def test_tdigest_byrank (decoded_r : valkey .Valkey [ str ] ):
457
457
assert await decoded_r .tdigest ().create ("t-digest" , 500 )
458
458
assert await decoded_r .tdigest ().add ("t-digest" , list (range (1 , 11 )))
459
459
assert 1 == (await decoded_r .tdigest ().byrank ("t-digest" , 0 ))[0 ]
@@ -464,7 +464,7 @@ async def test_tdigest_byrank(decoded_r: valkey.Valkey):
464
464
465
465
466
466
@pytest .mark .experimental
467
- async def test_tdigest_byrevrank (decoded_r : valkey .Valkey ):
467
+ async def test_tdigest_byrevrank (decoded_r : valkey .Valkey [ str ] ):
468
468
assert await decoded_r .tdigest ().create ("t-digest" , 500 )
469
469
assert await decoded_r .tdigest ().add ("t-digest" , list (range (1 , 11 )))
470
470
assert 10 == (await decoded_r .tdigest ().byrevrank ("t-digest" , 0 ))[0 ]
@@ -474,7 +474,7 @@ async def test_tdigest_byrevrank(decoded_r: valkey.Valkey):
474
474
(await decoded_r .tdigest ().byrevrank ("t-digest" , - 1 ))[0 ]
475
475
476
476
477
- # # async def test_pipeline(decoded_r: valkey.Valkey):
477
+ # # async def test_pipeline(decoded_r: valkey.Valkey[str] ):
478
478
# pipeline = await decoded_r.bf().pipeline()
479
479
# assert not await decoded_r.bf().execute_command("get pipeline")
480
480
#
0 commit comments