diff options
author | Alibi <aliby.bbb@gmail.com> | 2022-08-04 19:00:51 +0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-04 16:00:51 +0300 |
commit | 34f07a716f1029a38cc000177c931a7ea8bd712e (patch) | |
tree | fe50a0d29ccf5bea52a3907db2d416355bbde909 /tests/test_bloom.py | |
parent | aca005084a95110796cfd59b20c87ce7baaf94c0 (diff) | |
download | redis-py-34f07a716f1029a38cc000177c931a7ea8bd712e.tar.gz |
Add TDIGEST.TRIMMED_MEAN (#2300)
* Add tdigest trimmed mean command with test
* Add skip version for test
* add to module callbacks
Co-authored-by: Alibi Shalgymbay <a.shalgymbay@mycar.kz>
Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
Co-authored-by: dvora-h <dvora.heller@redis.com>
Diffstat (limited to 'tests/test_bloom.py')
-rw-r--r-- | tests/test_bloom.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_bloom.py b/tests/test_bloom.py index 1191542..12a4839 100644 --- a/tests/test_bloom.py +++ b/tests/test_bloom.py @@ -391,6 +391,17 @@ def test_tdigest_cdf(client): @pytest.mark.redismod @pytest.mark.experimental @skip_ifmodversion_lt("2.4.0", "bf") +def test_tdigest_trimmed_mean(client): + assert client.tdigest().create("tDigest", 100) + # insert data-points into sketch + assert client.tdigest().add("tDigest", list(range(1, 10)), [1.0] * 10) + assert 5 == client.tdigest().trimmed_mean("tDigest", 0.1, 0.9) + assert 4.5 == client.tdigest().trimmed_mean("tDigest", 0.4, 0.5) + + +@pytest.mark.redismod +@pytest.mark.experimental +@skip_ifmodversion_lt("2.4.0", "bf") def test_tdigest_mergestore(client): assert client.tdigest().create("sourcekey1", 100) assert client.tdigest().create("sourcekey2", 100) |