These are chat archives for getredash/redash

18th
Feb 2015
Cory
@clevinson
Feb 18 2015 10:11
@arikfr hey, i'm running on an amazon image and would like to delete some queries (unfortunately I'm not able to upgrade to the latest version with delete support right now)
@arikfr would running something like "delete from queries where id in (1,2,5,6)" work?
i can ssh into the machine, and am in the psql console as the redash user
Arik Fraimovich
@arikfr
Feb 18 2015 10:33
@clevinson I suspect it won't work because of foreign keys
Cory
@clevinson
Feb 18 2015 10:53
@arikfr do you have a suggested manual sql query to run to delete a list of query ID's or is the only reasonable way to upgrade the AMI verison?
Arik Fraimovich
@arikfr
Feb 18 2015 12:37
@clevinson I suspose that making a query should be feasilble and I can do it a little later today. But you will benefit more from upgrading :-)
Cory
@clevinson
Feb 18 2015 12:44
@arikfr can you link to documentation on upgrading & running migrations ? the current verison in /opt/redash/ is redash.0.4.0.b589
we're running from an AMI
Arik Fraimovich
@arikfr
Feb 18 2015 14:05
@clevinson sorry for the delay, instead of just writing instructions I updated the fabric to do it for you. Updated one is here: https://gist.github.com/arikfr/440d1403b4aeb76ebaf8
@clevinson it's split into several tasks, but the one that runs them all and you need to use is: "deploy_latest_release". You invoke it like this: fab -Hyour-redash-host -uubuntu deploy_latest_release
@clevinson (assuming you installed fabric with pip install fabric)
@clevinson regardless I will also add a wiki page to document this.
@clevinson I've tested it on an instance that ran your version, but let me know if you had any dificulties.
Cory
@clevinson
Feb 18 2015 14:15
TypeError 'bool' object is not callable
Arik Fraimovich
@arikfr
Feb 18 2015 14:16
@clevinson crap I've overwritten the link_to_current function with local function parameter...
@clevinson run the following:
@clevinson fab link_to_current:version_name=redash.0.5.0.b685 and fab restart_services
Cory
@clevinson
Feb 18 2015 14:21
ok. then rerun the deploy_latest_release task?
Arik Fraimovich
@arikfr
Feb 18 2015 14:21
@clevinson oh, no. from the log it looks like that the task worked up until it should've linked and restarted. you can confirm it by seeing /opt/redash/redash.0.5.0.b685 directory there
(fixed the gist also)
Cory
@clevinson
Feb 18 2015 14:38
thanks. all set now!
Arik Fraimovich
@arikfr
Feb 18 2015 14:39
@clevinson great! and archiving now works? (this is the final test that the migration worked)
Cory
@clevinson
Feb 18 2015 14:42
@arikfr yes, archiving works. thanks a bunch. Will the updated fabfile work in the future for getting new releases?
Arik Fraimovich
@arikfr
Feb 18 2015 14:43
@clevinson it should :)
Cory
@clevinson
Feb 18 2015 14:51
@arikfr i'm looking for documentation on how to use query parameters... looks like a nice feature! but once i have {{my_parameter}} in the SQL, how do I set it?
Arik Fraimovich
@arikfr
Feb 18 2015 14:52
@clevinson it's still in (very)early-alpha stage. so only through the query string in the url: i.e. redash/queries/1?pmy_parameter=whatever (i.e. prefix your param name with "p")
stupid markdown
it shuold be p_
Cory
@clevinson
Feb 18 2015 14:57
thanks!
one bug to report, i know its super alpha, but the URL strings are case insensitive and get translated to only lowercase when sending strings ;)
ie. ?p_myname=Cory get's set as myname=cory
Arik Fraimovich
@arikfr
Feb 18 2015 14:58
@clevinson weird. I'll look into it
@clevinson anyway I'll be happy to hear feedback for this feature and your use cases once you start using it more.
@clevinson here it seems to work: http://demo.redash.io/queries/145/source?p_test=Arik
@clevinson maybe something with how the value used in a query?
Cory
@clevinson
Feb 18 2015 15:08
@arikfr i think that's just hte formatting of your column that makes it look like a capital A
@arikfr ahh wait. nevermind! i didn't execute
Arik Fraimovich
@arikfr
Feb 18 2015 15:12
:)
@clevinson if you use the parameter to the set the column name, and use postegres, then it's case insensitive.
Cory
@clevinson
Feb 18 2015 15:14
@arikfr interesting.... so i think the issue was if you change it to change the query param value to the same stirng, but different case, then redash won't automatically reload the data when you refresh
you have to manually hit "execute query"
where as if you change the queyr param to a totally different string, and refresh, redash will automatically retrigger an execute
Arik Fraimovich
@arikfr
Feb 18 2015 15:15
@clevinson you nailed it. to determine if we have cached value for a query, we normalize it and lower case everything... oops
@clevinson you can add "&maxAge=0" to make sure it runs the query. on the other hand, you can add &maxAge={seconds} to make sure it uses some cached value, if available to (up to {seconds} old)
Cory
@clevinson
Feb 18 2015 15:35
danke!
martin sarsale
@runa
Feb 18 2015 15:42
@arikfr does it makes sense to you to add a &datasource parameter?
Arik Fraimovich
@arikfr
Feb 18 2015 15:47
@runa in query context, it's a no brainer. need to think about it in a dashboard context. but actually might be not a big deal
martin sarsale
@runa
Feb 18 2015 16:10
@arikfr tnx. query context is enough for me, right now
Arik Fraimovich
@arikfr
Feb 18 2015 16:23
@runa gave me more tought, both should be easy to implement. the dashboard might be even easier because no UI change is needed. if you want to take a stab at it, see how maxAge param is implemented
(in query context, you need to make sure datasource picker reflects the one you chose)
martin sarsale
@runa
Feb 18 2015 19:53
@arikfr ok. didn't had much luck with highcharts and adding a column as label