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

Query not running when changing dates #21

Open
g-bakas opened this issue Dec 15, 2022 · 0 comments
Open

Query not running when changing dates #21

g-bakas opened this issue Dec 15, 2022 · 0 comments

Comments

@g-bakas
Copy link

g-bakas commented Dec 15, 2022

Hey,

is there any max payload that someone can retrieve using the API you have created?
I have been using the library and have the following issue:

We define a start_date and an end_date:

  • start = convert_str_datetime_to_utc("2022-05-01 00:00:00")
  • end = convert_str_datetime_to_utc("2022-12-01 23:59:59")

The weird thing is that the query runs ok when the start_date is 2022-06-01 00:00:00 but when the start_date is 2022-05-01 00:00:00 the response you get is the following:

File ~/miniconda3/envs/opap-kpis/lib/python3.9/site-packages/redashAPI/client.py:125, in RedashAPIClient.query_and_wait_result(self, ds_id, query, timeout)
121 raise Exception('Polling timeout.')
123 time.sleep(0.2)
--> 125 return self.get(f'query_results/{query_result_id}')

File ~/miniconda3/envs/opap-kpis/lib/python3.9/site-packages/redashAPI/client.py:18, in RedashAPIClient.get(self, uri)
15 res = self.s.get(f"{self.host}/api/{uri}")
17 if res.status_code != 200:
---> 18 raise Exception(f"[GET] /api/{uri} ({res.status_code})")
20 return res

Exception: [GET] /api/query_results/2196159 (502)

Also I have noticed the same behaviour when adding some columns to a query that is running ok.

I was thinking that this is due to a max payload or a maximum number of lines the redash_api can fetch.

I should also mention here that the query is running on the redash client we have set up on a Kubernetes cluster.

Could you please look into this?

Thanks in advance!

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

1 participant