From 7cb22030aa8df56f4a4a9a7cec6bbab31610e535 Mon Sep 17 00:00:00 2001 From: joocer Date: Sat, 4 Jan 2025 17:51:29 +0000 Subject: [PATCH 1/2] #1954 --- tests/storage/test_cache_memcached.py | 8 ++++++-- tests/storage/test_cache_redis.py | 10 +++++++--- tests/storage/test_cache_valkey.py | 10 +++++++--- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/tests/storage/test_cache_memcached.py b/tests/storage/test_cache_memcached.py index 93c1a53f3..e40e887ab 100644 --- a/tests/storage/test_cache_memcached.py +++ b/tests/storage/test_cache_memcached.py @@ -26,6 +26,10 @@ def test_memcached_cache(): from opteryx import CacheManager from opteryx.managers.cache import MemcachedCache from opteryx.shared import BufferPool + from opteryx import register_store + from opteryx.connectors import GcpCloudStorageConnector + + register_store("opteryx", GcpCloudStorageConnector) cache = MemcachedCache() #cache._server.flush_all() @@ -37,7 +41,7 @@ def test_memcached_cache(): for i in range(10): cur = conn.cursor() time.sleep(0.01) - cur.execute("SELECT count(*) FROM testdata.flat.ten_files;") + cur.execute("SELECT count(*) FROM opteryx.ten_files;") print(f"hits: {cache.hits}, misses: {cache.misses}, skips: {cache.skips}, errors: {cache.errors}, sets: {cache.sets}") @@ -47,7 +51,7 @@ def test_memcached_cache(): buffer.reset() cur = conn.cursor() - cur.execute("SELECT count(*) FROM testdata.flat.ten_files;") + cur.execute("SELECT count(*) FROM opteryx.ten_files;") stats = cur.stats diff --git a/tests/storage/test_cache_redis.py b/tests/storage/test_cache_redis.py index 5e0b922c7..8f490614c 100644 --- a/tests/storage/test_cache_redis.py +++ b/tests/storage/test_cache_redis.py @@ -23,19 +23,23 @@ def test_redis_cache(): from opteryx import CacheManager from opteryx.managers.cache import RedisCache from opteryx.shared import BufferPool + from opteryx import register_store + from opteryx.connectors import GcpCloudStorageConnector + + register_store("opteryx", GcpCloudStorageConnector) cache = RedisCache() opteryx.set_cache_manager(CacheManager(cache_backend=cache)) # read the data once, this should populate the cache if it hasn't already - cur = opteryx.query("SELECT * FROM testdata.flat.ten_files;") - stats = cur.stats + cur = opteryx.query("SELECT * FROM opteryx.ten_files;") + cur.fetchall() buffer = BufferPool() buffer.reset() # read the data a second time, this should hit the cache - cur = opteryx.query("SELECT * FROM testdata.flat.ten_files;") + cur = opteryx.query("SELECT * FROM opteryx.ten_files;") assert cache.hits > 0 assert cache.misses < 12 diff --git a/tests/storage/test_cache_valkey.py b/tests/storage/test_cache_valkey.py index d6030d918..6a3359322 100644 --- a/tests/storage/test_cache_valkey.py +++ b/tests/storage/test_cache_valkey.py @@ -23,19 +23,23 @@ def test_valkey_cache(): from opteryx import CacheManager from opteryx.managers.cache import ValkeyCache from opteryx.shared import BufferPool + from opteryx import register_store + from opteryx.connectors import GcpCloudStorageConnector + + register_store("opteryx", GcpCloudStorageConnector) cache = ValkeyCache() opteryx.set_cache_manager(CacheManager(cache_backend=cache)) # read the data once, this should populate the cache if it hasn't already - cur = opteryx.query("SELECT * FROM testdata.flat.ten_files;") - stats = cur.stats + cur = opteryx.query("SELECT * FROM opteryx.ten_files;") + cur.fetchall() buffer = BufferPool() buffer.reset() # read the data a second time, this should hit the cache - cur = opteryx.query("SELECT * FROM testdata.flat.ten_files;") + cur = opteryx.query("SELECT * FROM opteryx.ten_files;") assert cache.hits > 0, cache.hits assert cache.misses < 12 From f02fd1ff3741da04c354cf008ffe3c5aea18d11f Mon Sep 17 00:00:00 2001 From: XB500 Date: Sat, 4 Jan 2025 17:51:52 +0000 Subject: [PATCH 2/2] Opteryx Version 0.19.1-alpha.952 --- opteryx/__version__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opteryx/__version__.py b/opteryx/__version__.py index 06d71cfa6..85fc4870a 100644 --- a/opteryx/__version__.py +++ b/opteryx/__version__.py @@ -1,4 +1,4 @@ -__build__ = 951 +__build__ = 952 # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.