duneanalytics / dune-client

A framework for interacting with Dune Analytics' officially supported API service
Apache License 2.0
85 stars 22 forks source link

add tests on new performance params and get_latest_result #58

Closed grkhr closed 1 year ago

grkhr commented 1 year ago
>>> python test_async_client.py
2023-06-05 17:32:06,945 INFO dune_client.base_client executing 1215383 on medium cluster
2023-06-05 17:32:07,594 INFO dune_client.base_client waiting for query execution 01H262ZQPK0T213MA4N9M45G84 to complete: ExecutionState.EXECUTING
...2023-06-05 17:32:13,496 INFO dune_client.base_client executing 1215383 on medium cluster
2023-06-05 17:32:13,887 INFO dune_client.base_client waiting for query execution 01H262ZXTYWNYSS8X74MDZK188 to complete: ExecutionState.EXECUTING
.2023-06-05 17:32:19,062 INFO dune_client.base_client executing 1215383 on large cluster
.2023-06-05 17:32:19,467 INFO dune_client.base_client executing 1215383 on medium cluster
2023-06-05 17:32:19,781 INFO dune_client.base_client waiting for query execution 01H26303NQWR62QXW9F6TY8KQG to complete: ExecutionState.PENDING (queue position: 1)
.
----------------------------------------------------------------------
Ran 6 tests in 18.005s

OK
>>> python test_client.py      
2023-06-05 17:32:30,759 INFO dune_client.base_client executing 1229120 on medium cluster
.2023-06-05 17:32:31,902 INFO dune_client.base_client executing 1215383 on medium cluster
...2023-06-05 17:32:34,069 INFO dune_client.base_client executing 1276442 on medium cluster
.2023-06-05 17:32:34,722 INFO dune_client.base_client executing 9999999999999 on medium cluster
2023-06-05 17:32:35,044 ERROR dune_client.models Can't build ExecutionResponse from {'error': 'Query not found'} due to KeyError: 'execution_id'
.2023-06-05 17:32:35,045 INFO dune_client.base_client executing 1215383 on medium cluster
2023-06-05 17:32:35,356 ERROR dune_client.models Can't build ExecutionResponse from {'error': 'invalid API Key'} due to KeyError: 'execution_id'
2023-06-05 17:32:35,650 ERROR dune_client.models Can't build ExecutionStatusResponse from {'error': 'invalid API Key'} due to KeyError: 'execution_id'
2023-06-05 17:32:36,015 ERROR dune_client.models Can't build ResultsResponse from {'error': 'invalid API Key'} due to KeyError: 'execution_id'
.2023-06-05 17:32:36,303 ERROR dune_client.models Can't build ExecutionStatusResponse from {'error': 'The requested execution ID (ID: Wonky Job ID) is invalid.'} due to KeyError: 'execution_id'
.2023-06-05 17:32:36,303 INFO dune_client.base_client executing 1215383 on medium cluster
.2023-06-05 17:32:37,328 INFO dune_client.base_client executing 99999999 on medium cluster
2023-06-05 17:32:37,687 ERROR dune_client.models Can't build ExecutionResponse from {'error': 'Query not found'} due to KeyError: 'execution_id'
.2023-06-05 17:32:37,689 INFO dune_client.base_client executing 1215383 on medium cluster
.2023-06-05 17:32:38,973 INFO numexpr.utils NumExpr defaulting to 8 threads.
2023-06-05 17:32:39,161 INFO dune_client.base_client executing 1215383 on medium cluster
.2023-06-05 17:32:40,018 INFO dune_client.base_client executing 1215383 on large cluster
.
----------------------------------------------------------------------
Ran 13 tests in 10.259s

OK
grkhr commented 1 year ago

hey @bh2smith

added some tests

bh2smith commented 1 year ago

Hey @grkhr -- I am trying to make use of this performance feature and continue to get this response when setting performance to "large":

'{"error":"Invalid performance tier"}'

Are you able to run the e2e tests locally?

Here is a failing CI run: https://github.com/cowprotocol/dune-client/actions/runs/5518368129/jobs/10062326261