-
Notifications
You must be signed in to change notification settings - Fork 13.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[sql lab] deeper support for templating #3996
Conversation
mistercrunch
commented
Dec 4, 2017
1dcb435
to
e082667
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, I just have a couple comments.
@@ -2161,6 +2161,8 @@ def sql_json(self): | |||
sql = request.form.get('sql') | |||
database_id = request.form.get('database_id') | |||
schema = request.form.get('schema') or None | |||
template_params = json.loads( | |||
request.form.get('templateParams') or '{}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get
takes a default parameter:
template_params = json.loads(request.form.get('templateParams', '{}'))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intent of the or
is to handle an existing key with an empty string value, though I could probably trim
renderDoc() { | ||
return ( | ||
<p> | ||
Assign a set of parameters as <code>JSON</code> bellow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/bellow/below/g
* [sql lab] deeper support for templating * Fixing py tests * Fix typo
* [sql lab] deeper support for templating * Fixing py tests * Fix typo