guillaumewibaux commented on issue #1996: Custom SQL queries with filters URL: https://github.com/apache/incubator-superset/issues/1996#issuecomment-385898140 I tried to access "time_grain_sqla" (or any other key) in _form_data_ dict in Explore but I am afraid that it is empty. I think it was added at some point: https://github.com/apache/incubator-superset/commit/a0ddbb9ec954a65a77350bc054b83e35bc4dffeb#diff-f25a00842d88e3e5cc4e4bcc822d40f7 but removed since i don't know why: ``` def get_sqla_query( # sqla self, groupby, metrics, granularity, from_dttm, to_dttm, filter=None, # noqa is_timeseries=True, timeseries_limit=15, timeseries_limit_metric=None, row_limit=None, inner_from_dttm=None, inner_to_dttm=None, orderby=None, extras=None, columns=None, order_desc=True, prequeries=None, is_prequery=False, ): """Querying any sqla table from this common interface""" template_kwargs = { 'from_dttm': from_dttm, 'groupby': groupby, 'metrics': metrics, 'row_limit': row_limit, 'to_dttm': to_dttm, 'filter': filter, 'columns': {col.column_name: col for col in self.columns}, } ``` So what I get is the empty dict from the constructor: ``` self.context = { 'url_param': url_param, 'current_user_id': current_user_id, 'current_username': current_username, 'form_data': {}, } ``` https://github.com/apache/incubator-superset/blob/510ae84b3b3c3880393b84ba1db6d9979ecb63e0/superset/jinja_context.py#L92
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
