Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError #7

Open
Lathesh-B-L opened this issue Sep 4, 2018 · 1 comment
Open

KeyError #7

Lathesh-B-L opened this issue Sep 4, 2018 · 1 comment

Comments

@Lathesh-B-L
Copy link

Lathesh-B-L commented Sep 4, 2018

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'
@davidgasquez
Copy link
Contributor

Hey there @Lathesh-B-L!

Would you mind trying with the 3.0 API endpoint (https://looker.company.com:19999/api/3.0/)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants