mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
feat(chart): Enable caching per user when user impersonation is enabled (#20114)
* add username to extra cache keys when impersonation is enabled. * don't put effective_user in extra_cache_key * get_impersonation_key method in engine_spec class to construct an impersonation key * pass datasource when creating query objects * adding an impersonation key when construction cache key * add feature flag to control caching per user * revert changes * make precommit and pylint happy * pass a User instance * remove unnecessary import
This commit is contained in:
@@ -58,7 +58,9 @@ class QueryContextFactory: # pylint: disable=too-few-public-methods
|
||||
result_type = result_type or ChartDataResultType.FULL
|
||||
result_format = result_format or ChartDataResultFormat.JSON
|
||||
queries_ = [
|
||||
self._query_object_factory.create(result_type, **query_obj)
|
||||
self._query_object_factory.create(
|
||||
result_type, datasource=datasource, **query_obj
|
||||
)
|
||||
for query_obj in queries
|
||||
]
|
||||
cache_values = {
|
||||
|
||||
Reference in New Issue
Block a user