diff --git a/dune_client/api/base.py b/dune_client/api/base.py index dae2d64..79abddf 100644 --- a/dune_client/api/base.py +++ b/dune_client/api/base.py @@ -96,7 +96,7 @@ def _build_parameters( sort_by: Optional[List[str]] = None, limit: Optional[int] = None, offset: Optional[int] = None, - allow_partial_results: bool = True, + allow_partial_results: str = "true", ) -> Dict[str, Union[str, int]]: """ Utility function that builds a dictionary of parameters to be used diff --git a/dune_client/api/execution.py b/dune_client/api/execution.py index 560289c..e15e6bd 100644 --- a/dune_client/api/execution.py +++ b/dune_client/api/execution.py @@ -81,7 +81,7 @@ def get_execution_results( sample_count: Optional[int] = None, filters: Optional[str] = None, sort_by: Optional[List[str]] = None, - allow_partial_results: bool = True, + allow_partial_results: str = "true", ) -> ResultsResponse: """GET results from Dune API for `job_id` (aka `execution_id`)""" params = self._build_parameters( diff --git a/dune_client/api/extensions.py b/dune_client/api/extensions.py index 16dab45..44fda20 100644 --- a/dune_client/api/extensions.py +++ b/dune_client/api/extensions.py @@ -54,7 +54,7 @@ def run_query( sample_count: Optional[int] = None, filters: Optional[str] = None, sort_by: Optional[List[str]] = None, - allow_partial_results: bool = True, + allow_partial_results: str = "true", ) -> ResultsResponse: """ Executes a Dune `query`, waits until execution completes, @@ -418,6 +418,8 @@ def _refresh( ) time.sleep(ping_frequency) status = self.get_execution_status(job_id) + if status.state == ExecutionState.PENDING: + self.logger.warning("Partial result set retrieved.") if status.state == ExecutionState.FAILED: self.logger.error(status) raise QueryFailed(f"Error data: {status.error}") diff --git a/dune_client/client_async.py b/dune_client/client_async.py index 2db989e..7af0b20 100644 --- a/dune_client/client_async.py +++ b/dune_client/client_async.py @@ -175,6 +175,7 @@ async def _get() -> Any: headers=self.default_headers(), params=params, ) + print(response) if raw: return response return await self._handle_response(response) diff --git a/dune_client/models.py b/dune_client/models.py index 15c96ff..d648f08 100644 --- a/dune_client/models.py +++ b/dune_client/models.py @@ -312,6 +312,7 @@ class ResultsResponse: @classmethod def from_dict(cls, data: dict[str, str | int | ResultData]) -> ResultsResponse: """Constructor from dictionary. See unit test for sample input.""" + print(data) assert isinstance(data["execution_id"], str) assert isinstance(data["query_id"], int) assert isinstance(data["state"], str)