mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
chore: log cache keys to the logs (#10678)
* Log cache keys to the logs * Add tests * Use separate table for the cache keys * Add migration for the cache lookup table Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
This commit is contained in:
@@ -35,6 +35,7 @@ from unittest import mock, skipUnless
|
||||
import pandas as pd
|
||||
import sqlalchemy as sqla
|
||||
|
||||
from superset.models.cache import CacheKey
|
||||
from tests.test_app import app # isort:skip
|
||||
import superset.views.utils
|
||||
from superset import (
|
||||
@@ -583,6 +584,12 @@ class TestCore(SupersetTestCase):
|
||||
+ quote(json.dumps([{"col": "name", "op": "in", "val": ["Jennifer"]}]))
|
||||
) == [{"slice_id": slc.id, "viz_error": None, "viz_status": "success"}]
|
||||
|
||||
def test_cache_logging(self):
|
||||
slc = self.get_slice("Girls", db.session)
|
||||
self.get_json_resp("/superset/warm_up_cache?slice_id={}".format(slc.id))
|
||||
ck = db.session.query(CacheKey).order_by(CacheKey.id.desc()).first()
|
||||
assert ck.datasource_uid == "3__table"
|
||||
|
||||
def test_shortner(self):
|
||||
self.login(username="admin")
|
||||
data = (
|
||||
|
||||
Reference in New Issue
Block a user