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

Implement get_latest_result_dataframe helper function #100

Merged
merged 1 commit into from
Oct 10, 2023

Conversation

TheEdgeOfRage
Copy link
Member

The get_latest_result implementation parses json,
which is slow for large results. The csv endpoint
is a lot more efficient, especially if you just
need to put the data into a pandas DataFrame.
get_latest_result_dataframe is a helper function
that calls download_csv and returns a DataFrame
from the result.

@TheEdgeOfRage TheEdgeOfRage requested review from msf and bh2smith October 10, 2023 17:06
The get_latest_result implementation parses json,
which is slow for large results. The csv endpoint
is a lot more efficient, especially if you just
need to put the data into a pandas DataFrame.
get_latest_result_dataframe is a helper function
that calls download_csv and returns a DataFrame
from the result.
@@ -118,6 +118,27 @@ def get_latest_result(
except KeyError as err:
raise DuneError(response_json, "ResultsResponse", err) from err

def get_latest_result_dataframe(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this is a performance improvement for the examples on https://github.com/duneanalytics/dune-client/pull/99/files

@bh2smith
Copy link
Collaborator

I re-ran the failing test to see if it was just an intermittent failure.

@bh2smith bh2smith merged commit 7dfcc0c into main Oct 10, 2023
@bh2smith bh2smith deleted the latest-result-dataframe branch October 10, 2023 17:59
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

Successfully merging this pull request may close these issues.

3 participants