Skip to content

[CONTRIBUTION] Feature Parity: Implement missing download_csv and get_latest_result_dataframe in AsyncDuneClient #188

@nice-bills

Description

@nice-bills

Currently, there is a functional disparity between DuneClient (sync) and AsyncDuneClient. Several high-utility methods available in the synchronous client are missing from the asynchronous implementation, specifically:

download_csv(): Essential for fetching large datasets efficiently as streams.
get_latest_result_dataframe(): A convenience method widely used by data scientists to fetch results directly into Pandas.
run_sql() (Plus feature): For executing raw SQL.

Users migrating to async workflows (e.g., using asyncio to run concurrent queries) currently lose access to these convenient methods. They are forced to either:

  1. Manually implement the HTTP fetching/parsing logic.
  2. Fall back to synchronous calls, blocking their event loop.

I would like to contribute a PR to implement these missing methods in AsyncDuneClient, ensuring they match the behavior of their synchronous counterparts in client.py but using aiohttp / async patterns.

Proposed Changes:

  1. Implement download_csv in client_async.py using aiohttp streams.
  2. Implement get_latest_result_dataframe (wrapping the CSV download).
  3. Add relevant unit tests.

If this aligns with the project's roadmap, I am happy to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions