API for importing queries doesn't respect is_draft, and seems to lack update ability


#1

Interesting in the API there is a boolean parameter you can pass in when POSTing queries to an instance of redash that is “is_draft” (True or False)

However, in the post class method that receives this data, there is this line

…which negates whatever you pass in. The other interesting thing is that for queries, there doesn’t appear to be a way to update an existing query via the AP


#2

Where I wrote:

“The other interesting thing is that for queries, there doesn’t appear to be a way to update an existing query via the API”

That is wrong. You can update against an individual record via the url /api/queries/ POSTing a parameter (like is_draft)


#3

I’m happy to accept a pull request that changes this API call to accept an optional is_draft value, so you can set it to False on creation.