Most probably valid REST call '.../v3/sql' failed with error 400

Hi Dremio,
I’m trying to query Dremio 3.01 through REST api …/v3/sql via Python 3.6 with
{
‘sql’: ’ ‘SELECT * FROM LAB.DEMO.SomeTableName’
‘context’: ‘’
}
and header set to
{
‘Content-Type’: ‘application/json’,
‘Authorization’: ‘_dremio’ + self.dremio.authentication_token
}

Anything seems to be ok, I’m connected (have a valid token), the table exists (the query is valid) and get 400 response with the following error:

Can not deserialize instance of java.util.ArrayList out of VALUE_STRING token at [Source: org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream@75674a70; line: 1, column: 55] (through reference chain: com.dremio.dac.explore.model.CreateFromSQL[“context”])

Any idea?

Thx Thomas

Hi @thomasz,

If you remove the context field from the JSON then it should work - context is expected to be an array and not a string.

We are working on improving our error handling as that error is not very helpful.

You are my hero. Thx Doron

What should be the format of the path inside the context?