I am trying to execute the following command to test API but getting response 400
import json
import os
from urllib.parse import urljoin, urlencode
import pyarrow
import requests
# NOTE set debuglevel = 1 (or higher) for http debug logging
from http.client import HTTPConnection
HTTPConnection.debuglevel = 0
HOST = "adb-8788787878787887887.2.azuredatabricks.net"
WAREHOUSE = "564016fc86e262g"
AUTH_TOKEN = "jshjdhsd887d8s7d87sjhdjshdjshdsjd-2"
assert URL and WAREHOUSE and AUTH_TOKEN, "Required: HOST||URL, WAREHOUSE, and AUTH_TOKEN"
# example statement big enough to exceed 5MB data requirement
limit = None
sql_statement = "SELECT X,Y,Z FROM A LIMIT 10"
payload = json.dumps({
"statement": sql_statement,
"warehouse_id": WAREHOUSE,
"wait_timeout": "500s",
"disposition": "EXTERNAL_LINKS",
"format": "ARROW_STREAM"
})
headers = {
'Content-Type': 'application/json'
}
auth=('token', AUTH_TOKEN)
response = requests.post(URL, auth=auth, headers=headers, data=payload)