Python query runner result filter example


#1

Hi, I am new to redash, I was able to enable the python query runner and wrote a simple query to access some data through REST API, I am wondering whether I can add filter to the result so I can have more control on the visualization? Below is the sample python query snippet:

API_USER = “user”
API_PASS = “password”
auth = HTTPBasicAuth(API_USER, API_PASS)
url = ‘https://hostname/stats/table
response = requests.get(url, params=None, auth=auth, headers=None, verify=False, stream=False)
result = response.json()

Let’s say the result contains several appID and their corresponding cpu usage, I just want to show the bar chart for a particular appID. Appreciate if someone can show an example or point me to the documentation of how this can be done.


#2

Figured out a way to do this: through the use of the {{}} parameters.
Appreciate if someone can show other ways of doing it.