Skip to content

Commit

Permalink
Adding template_params to datasource editor for sqla tables (apache#6869
Browse files Browse the repository at this point in the history
)

(cherry picked from commit b0f7f51)
  • Loading branch information
michellethomas authored and Grace Guo committed Mar 18, 2019
1 parent 6b89541 commit a5d9a4e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions superset/assets/src/datasource/DatasourceEditor.jsx
Expand Up @@ -448,6 +448,14 @@ export class DatasourceEditor extends React.PureComponent {
label={t('Hours offset')}
control={<TextControl />}
/>
{ this.state.isSqla &&
<Field
fieldKey="template_params"
label={t('Template parameters')}
descr={t('A set of parameters that become available in the query using Jinja templating syntax')}
control={<TextControl />}
/>
}
</Fieldset>);
}

Expand Down
1 change: 1 addition & 0 deletions superset/connectors/sqla/models.py
Expand Up @@ -422,6 +422,7 @@ def data(self):
d['time_grain_sqla'] = grains
d['main_dttm_col'] = self.main_dttm_col
d['fetch_values_predicate'] = self.fetch_values_predicate
d['template_params'] = self.template_params
return d

def values_for_column(self, column_name, limit=10000):
Expand Down

0 comments on commit a5d9a4e

Please sign in to comment.