mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
fix: caching on viz with relative time ranges and time compare (#10061)
This commit is contained in:
@@ -122,7 +122,21 @@ class CoreTests(SupersetTestCase):
|
||||
cache_key = viz.cache_key(qobj)
|
||||
|
||||
qobj["groupby"] = []
|
||||
self.assertNotEqual(cache_key, viz.cache_key(qobj))
|
||||
cache_key_with_groupby = viz.cache_key(qobj)
|
||||
self.assertNotEqual(cache_key, cache_key_with_groupby)
|
||||
|
||||
self.assertNotEqual(
|
||||
viz.cache_key(qobj), viz.cache_key(qobj, time_compare="12 weeks")
|
||||
)
|
||||
|
||||
self.assertNotEqual(
|
||||
viz.cache_key(qobj, time_compare="28 days"),
|
||||
viz.cache_key(qobj, time_compare="12 weeks"),
|
||||
)
|
||||
|
||||
qobj["inner_from_dttm"] = datetime.datetime(1901, 1, 1)
|
||||
|
||||
self.assertEquals(cache_key_with_groupby, viz.cache_key(qobj))
|
||||
|
||||
def test_get_superset_tables_not_allowed(self):
|
||||
example_db = utils.get_example_database()
|
||||
|
||||
Reference in New Issue
Block a user