These are chat archives for getredash/redash

13th
Jun 2016
Arik Fraimovich
@arikfr
Jun 13 2016 10:15
@Mikodes it's something custom we did in Redash. No documentation ,but just try the example I gave you for a date field. Should be straighforward.
@martinmalek I'm not aware of such comparison. You're welcome to try both and see for yourself. Each has its strengths.
@solutionrooms it wasn't clear from your first message that you want to use the API with parameters. Currently we don't support this. It is something I want to support, but it depends on the implementation.
Jon Scott
@solutionrooms
Jun 13 2016 10:33
This message was deleted
@arikfr
let me know how you think this should be called, i.e. what the url should be, I will see whether i can contribute what I have created. I know you have some plans on how the current synchronous embed functionality should change, and my existing implementation builds on that existing embed code.
Arik Fraimovich
@arikfr
Jun 13 2016 11:32
@solutionrooms current synchronous embed code is temporary solution which I don't recommend using unless you really need it and understand the consequences. Proper solution should not block the web server -- either by moving the polling logic to the client (like we currently do) or by making Redash server async (by using gevent?).
Jon Scott
@solutionrooms
Jun 13 2016 12:40

@arikfr

For my use case - I would really like to run async for the web server - but sync from the client (for simplicity) - so "making Redash server async" would be ideal way to go. I imagine this change to be non-trivial.

The other option of moving the polling logic to the client should ALSO be possible as this would satisfy different use cases, this would need reports to be able to be run and saved from the api/query, which is currently not possible(?). report results are only saved when the user hits save on the edit screen. to enable this we would need to add some way for a url to specify that a report should be saved. e.g.
http://server/queries/4/source?p_jon=17&save=true
Which would run the report and save the result, which could then be picked up (when complete) by
http://server/api/queries/4/results.json?api_key=asd

Arik Fraimovich
@arikfr
Jun 13 2016 12:48

@solutionrooms actually making Redash server async might not be that complicated (just apply gevent's monkey patching), but will require some testing to make sure everything indeed works as expected.

As for saving results: resulting are always saved regardless of if there is a query for them. What's needed is logic to handle parameters in the server.

You can temporary use the refresh api as a temporary workaround, which supports parameters.

Jon Scott
@solutionrooms
Jun 13 2016 13:12

@arikfr
in response to "resulting are always saved regardless of if there is a query for them"
I have tried latest 10 and 11 versions, if I :
http://server/queries/4/source?p_jon=17
then press "save" on the screen
then run
http://server/queries/4/source?p_jon=18
then
http://server/api/queries/4/results.json?api_key=asd
I get the 17 result - not the 18

PS I was trying to set up an example of this on demo.redash.io but queries are not running on that at the moment(?)

Arik Fraimovich
@arikfr
Jun 13 2016 13:14
@solutionrooms as mentioned, the results API doesn't support query parameters. it doesn't mean that the query result isn't somewhere there.
Jon Scott
@solutionrooms
Jun 13 2016 13:19
@arikfr
where is it? does the save button move it somewhere / register it somewhere so that it can be seen by the API?
Nick Grygiel
@ngrygs
Jun 13 2016 13:34
Hey, is there some way to access all of the dashboards created? The drop-down menu only lists about half of them, with the other half being cut off at the bottom of the page (The list doesn't scroll, is this a bug?). I know there's no 'My Dashboards' page, but is there any way to access all of them?
Jon Scott
@solutionrooms
Jun 13 2016 13:43

@arikfr
the demo server is working again so
https://demo.redash.io/queries/1930/source?p_jon=100
followed by pressing "save"
then
https://demo.redash.io/queries/1930/source?p_jon=101

is this the expected behaviour?

Arik Fraimovich
@arikfr
Jun 13 2016 15:43
@solutionrooms currently the view updates reference to the last result the query has (which the results.json call retrieves). This is an unwanted side effect, that I'm going to remove in #1069...
Jon Scott
@solutionrooms
Jun 13 2016 17:01
@arikfr
ok - thanks, i see.
Jeff Widman
@jeffwidman
Jun 13 2016 19:58
how do I change the default data source
?
Jeff Widman
@jeffwidman
Jun 13 2016 20:42
actually, I asked over in discourse, i think that's a better place to answer as it'll get picked up by google better for others in teh future