hashboard-hq / hashquery

A Python framework for defining and querying BI models in your data warehouse

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failing authentication verification with TypeError

njhuffman opened this issue · comments

Python version: 3.9.9
Hashquery version: 0.2.1

Problem: I have followed the authentication steps, but am failing the authentication verification with this error

>>> from hashquery import *
>>> print(project)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../hashquery/hashboard_api/project_manifest.py", line 63, in __repr__
    str(self.models),
  File ".../hashquery/hashboard_api/project_manifest.py", line 131, in __repr__
    aliases = ", ".join(self._item_alias(i) for i in self.get_all())
  File ".../hashquery/hashboard_api/project_manifest.py", line 95, in get_all
    self._cache = self._get_all_impl()
  File ".../hashquery/hashboard_api/project_manifest.py", line 147, in _get_all_impl
    return fetch_all_models(self._project_id)
  File ".../hashquery/hashboard_api/project_importer.py", line 12, in fetch_all_models
    wire_models = HashboardAPI.get_for_project(project_id).graphql(
TypeError: 'NoneType' object is not subscriptable

Going a layer deeper, I tried running this to see where None was coming from

>>> from hashquery.hashboard_api.api import HashboardAPI
>>> HashboardAPI.get_for_project(project.project_id).graphql("""query HashqueryModels($projectId: String!) {hashqueryModels(projectId: $projectId)}""", {"projectId": project.project_id})
{'data': None, 'errors': [{'locations': [{'column': 45, 'line': 1}], 'message': 'Unexpected error', 'path': ['hashqueryModels']}]}

I have the same problem using both the CLI credentials and the API token. If I delete both, I get project.project_id == None, and when using either one, I get project.project_id == 'some-hex-string', so I know the authentication data is at least being found.

What else can I try to resolve?

Hi there! Thanks for the report. Good news is your authentication is correct.

This is an internal error coming from our servers when exporting your models. We're working now to deploy a server side fix. I'll comment back once its live, and you should be able to try again (no need to change your code or upgrade hashquery).

We've deployed the fix on the server side. You should be able to try again now and get unstuck

Ran again, no problems 😎
Thanks for the 3 hour turnaround!