engine: get fact table from configuration (#41814)

This commit is contained in:
Benjamin Dauvergne 2020-04-17 18:55:25 +02:00
parent 226d162b25
commit 7cab96b989
1 changed files with 2 additions and 2 deletions

View File

@ -309,8 +309,8 @@ class JSONDimensions(object):
return []
if not self.__cache:
with self.engine.get_cursor() as cursor:
sql = ('select distinct jsonb_object_keys(%s) as a from formdata order by a'
% self.engine_cube.json_field)
sql = ('select distinct jsonb_object_keys(%s) as a from %s order by a'
% (self.engine_cube.json_field, self.engine_cube.fact_table))
cursor.execute(sql)
self.__cache = [row[0] for row in cursor.fetchall()]
return self.__cache