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: 'Query' when running github dashboard example #45

Closed
petrus-jvrensburg opened this issue Jul 10, 2019 · 3 comments · Fixed by #46
Closed

KeyError: 'Query' when running github dashboard example #45

petrus-jvrensburg opened this issue Jul 10, 2019 · 3 comments · Fixed by #46
Assignees
Labels
bug Something isn't working

Comments

@petrus-jvrensburg
Copy link
Contributor

petrus-jvrensburg commented Jul 10, 2019

I'm trying to run the example like:

python examples/github/github-agile-dashboard.py --token <TOKEN> flask-admin/flask-admin save

But I'm getting:

Traceback (most recent call last):
  File "/Users/petrus/code/sgqlc/env/lib/python3.7/site-packages/sgqlc/types/__init__.py", line 664, in __getattr__
    return self.__all[key]
KeyError: 'Query'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "examples/github/github-agile-dashboard.py", line 935, in <module>
    args.func(endpoint, args)
  File "examples/github/github-agile-dashboard.py", line 450, in cmd_save
    args.label, args.issue_state, args.pr_state)
  File "examples/github/github-agile-dashboard.py", line 202, in download
    op = Operation()
  File "/Users/petrus/code/sgqlc/env/lib/python3.7/site-packages/sgqlc/operation/__init__.py", line 1596, in __init__
    typ = global_schema.Query
  File "/Users/petrus/code/sgqlc/env/lib/python3.7/site-packages/sgqlc/types/__init__.py", line 666, in __getattr__
    raise AttributeError(key) from exc
AttributeError: Query
@barbieri barbieri self-assigned this Jul 10, 2019
@barbieri barbieri added the bug Something isn't working label Jul 10, 2019
@barbieri
Copy link
Member

I'll look, but will need some time as I'm under some heavy work load atm :-(

The global_schema should be automatically populated when importing the generated github_schema.py, this would create the Query attribute. Could you check your running environment, see if there is nothing missing?

My advice is to run pipenv install -d and then pipenv shell, to later run the example. I usually run the example from within its folder

@petrus-jvrensburg
Copy link
Contributor Author

Okay thanks. It doesn't seem to be environment-related, but let me dig in to it a bit more.

@barbieri
Copy link
Member

while adding schema.Query is okay, was your problem solved without it, only using the correct env setup? (otherwise it should be a bug)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants