Skip to content

Remove async_trait dependency: async fn in traits is stable since Rust 1.75 #125

@alxmrs

Description

@alxmrs

Problem

Cargo.toml includes async-trait = '0.1' and src/lib.rs uses #[async_trait] on the TableProvider impl for PrunableStreamingTable.

The async_trait proc-macro crate was a workaround before Rust 1.75 (December 2023), which stabilized async fn in traits (RPITIT). The proc-macro generates less efficient code — it heap-allocates a Box<dyn Future> for each async call — whereas native async fn in traits avoids this overhead.

Steps

  1. Check whether the DataFusion TableProvider trait definition already uses native async fn (it should in recent versions).
  2. If so, remove the #[async_trait] attribute from the PrunableStreamingTable impl.
  3. Remove async-trait from Cargo.toml [dependencies].
  4. Verify with cargo test that nothing breaks.

Benefit

Reduces dependency count and eliminates unnecessary heap allocations in the async execution path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions