This is an automated email from the ASF dual-hosted git repository.
yjc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new b89a5d6 fix: dashboard cache invalid join query (#11369)
b89a5d6 is described below
commit b89a5d66604bfa63b178fc04f7e2e80781729a93
Author: Jesse Yang <[email protected]>
AuthorDate: Thu Oct 22 12:47:59 2020 -0700
fix: dashboard cache invalid join query (#11369)
* bugfix: dashboard cache invalid join query
* Use engine instead of session
---
superset/models/dashboard.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/superset/models/dashboard.py b/superset/models/dashboard.py
index e505b92..7779538 100644
--- a/superset/models/dashboard.py
+++ b/superset/models/dashboard.py
@@ -302,7 +302,7 @@ class Dashboard( # pylint:
disable=too-many-instance-attributes
filter_query = select([dashboard_slices.c.dashboard_id],
distinct=True).where(
dashboard_slices.c.slice_id == slice_id
)
- for (dashboard_id,) in db.session.execute(filter_query):
+ for (dashboard_id,) in db.engine.execute(filter_query):
cls(id=dashboard_id).clear_cache()
@classmethod
@@ -312,13 +312,13 @@ class Dashboard( # pylint:
disable=too-many-instance-attributes
[dashboard_slices.c.dashboard_id], distinct=True,
).select_from(
join(
- Slice,
dashboard_slices,
- Slice.id == dashboard_slices.c.slice_id,
- Slice.datasource_id == datasource_id,
+ Slice,
+ (Slice.id == dashboard_slices.c.slice_id)
+ & (Slice.datasource_id == datasource_id),
)
)
- for (dashboard_id,) in db.session.execute(filter_query):
+ for (dashboard_id,) in db.engine.execute(filter_query):
cls(id=dashboard_id).clear_cache()
@classmethod
@@ -598,7 +598,7 @@ if is_feature_enabled("DASHBOARD_CACHE"):
sqla.event.listen(Slice, "after_update", clear_dashboard_cache)
sqla.event.listen(Slice, "after_delete", clear_dashboard_cache)
sqla.event.listen(
- BaseDatasource, "after_update", clear_dashboard_cache, propagage=True
+ BaseDatasource, "after_update", clear_dashboard_cache, propagate=True
)
# also clear cache on column/metric updates since updates to these will not
# trigger update events for BaseDatasource.