duneanalytics / dune-client

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

Partially completed query state not captured by SDK #124

Closed travs closed 1 month ago

travs commented 5 months ago

Over here we don't have the query state QUERY_STATE_COMPLETED_PARTIAL.

May be related to #118 (allow partial flag).

couralex6 commented 5 months ago

@bh2smith is this on the roadmap? I ran into some issues with this missing state

bh2smith commented 5 months ago

I am sure it will be done at some point, although I don't have capacity for this at the moment. Maybe @waddahAldrobi?

We also welcome community contributions!

barkntuncer commented 5 months ago

Hey guys, I faced the QUERY_STATE_COMPLETED_PARTIAL issue as well. I was wondering if that's an issue or if the query is supposed to keep going if there was a state for it

ValueError: 'QUERY_STATE_COMPLETED_PARTIAL' is not a valid ExecutionState
bh2smith commented 5 months ago

Oh... so your "run_query" is failing because its a long running query and we are unable to parse the type so it fails! If this is a major blocker we can include the new query execution state without actually making use of it (so the program doesn't crash because of a parse error). I opened a PR #125.

If this is blocking your complex query from running (i.e. crashing the program), let me know and I can get a hot-fix out ASAP.

RichardKeo commented 5 months ago

QUERY_STATE_COMPLETED_PARTIAL doesn't actually describe a long running query; it's returned when the query executes successfully but the result gets truncated because it is too large.

I've added a note internally to document this.

bh2smith commented 5 months ago

So then partial would also constitute a terminal state. I can add that to the PR logic.

barkntuncer commented 5 months ago

Oh... so your "run_query" is failing because its a long running query and we are unable to parse the type so it fails! If this is a major blocker we can include the new query execution state without actually making use of it (so the program doesn't crash because of a parse error). I opened a PR #125.

If this is blocking your complex query from running (i.e. crashing the program), let me know and I can get a hot-fix out ASAP.

Yes, that's exactly right together with @RichardKeo 's comment. I am getting some transaction hashes for a bit of a long period using the API. I was thinking I would get partial results similar to using the UI. It's right now a blocker. Well can be considered a warning as well indicating I need to tighten my limits.

barkntuncer commented 5 months ago

So then partial would also constitute a terminal state. I can add that to the PR logic.

I feel like it should be similar to the UI. Let's get the output out and show a warning this is a partial result. Is that what you mean as well?

jake-selini commented 1 month ago

hey folks any update on this issue? this is a major blocker for us

bh2smith commented 1 month ago

Sorry about the wait on this. I have revived and dusted-off the proposed PR #125, merged and released under v1.7.5. Please let me know if you encounter any issues.

Note that this is an open source repo and could have taken this over at any point.