Skip to content
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

Merged
merged 3 commits into from
Dec 19, 2017

Conversation

mistercrunch
Copy link
Member

params

@john-bodley
Copy link
Member

Copy link

@graceguo-supercat graceguo-supercat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@betodealmeida betodealmeida left a 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 '{}')
Copy link
Member

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', '{}'))

Copy link
Member Author

@mistercrunch mistercrunch Dec 15, 2017

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/bellow/below/g

@mistercrunch mistercrunch merged commit 44e753d into apache:master Dec 19, 2017
@mistercrunch mistercrunch deleted the template_params branch December 19, 2017 23:56
michellethomas pushed a commit to michellethomas/panoramix that referenced this pull request May 24, 2018
* [sql lab] deeper support for templating

* Fixing py tests

* Fix typo
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
* [sql lab] deeper support for templating

* Fixing py tests

* Fix typo
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.23.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.23.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants