pylooker
pylooker copied to clipboard
KeyError
Hi David,
Here is the sample code, which I am trying to run the query, can you please suggest how to resolve the KeyError
import pandas as pd
import json
from pylooker.client import LookerClient
api_endpoint = 'https://<my-looker-endpoint>:19999/api/3.1/'
client_id = '<my-looker-client_id>'
client_secret = '<my-looker-client_secret>'
lc = LookerClient(api_endpoint, client_id, client_secret)
query_data = lc.run_query('<my-looker-Query_ID>')
print(type(query_data))
KeyError Traceback (most recent call last)
<ipython-input-22-9041a9264702> in <module>()
---> 14 query_data = lc.run_query('<my-looker-Query_ID>')
15 print(type(query_data))
16 #df = pd.DataFrame(look_data)
~\AppData\Local\Continuum\anaconda3\lib\site-packages\pylooker\client.py in run_query(self, slug, format, limit)
118 url="{}{}/run/{}?limit={}".format(
119 self.api_endpoint + "queries/",
--> 120 slug_response.json()["id"],
121 format,
122 limit,
KeyError: 'id'
Hey there @Lathesh-B-L!
Would you mind trying with the 3.0 API endpoint (https://looker.company.com:19999/api/3.0/)?