chore: remove async-trait from dependency graph - #25160
Draft
rtyler wants to merge 4 commits into
Draft
Conversation
…atures Convert trait definitions in session, datasource, execution, and expr crates from #[async_trait] to explicit BoxFuture<'a, ...> return types (the desugared form async_trait produces), and mechanically transform impl blocks across the workspace to match. Async blocks do not get the unsized coercion that async fn return positions did, so returned concrete Arc<T> values gain explicit 'as Arc<dyn Trait>' casts where required. Ref: apache#17689 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: R Tyler Croy <rtyler@scribd.com>
Remove async-trait from 18 crates that no longer use it after the BoxFuture conversion. Move it to dev-dependencies in datafusion-datasource (only used in a cfg(test) ObjectStore impl). async-trait remains a dependency only where impls of external traits still require it: datafusion-cli and benchmarks (object_store's ObjectStore / CredentialProvider), datafusion-sqllogictest (sqllogictest's AsyncDB), and datafusion-core (ObjectStore test utilities). Also convert CliSessionContext (datafusion-cli) to BoxFuture signatures, update the SubstraitConsumer doc example, and drop now-unused async_trait imports and doc references. Ref: apache#17689 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: R Tyler Croy <rtyler@scribd.com>
- Elide unnecessary explicit lifetimes where only &self is borrowed - Fix doc list indentation and markdown lazy continuations - Remove unused imports and needless return - Apply clippy --fix suggestions across the workspace cargo clippy --workspace --all-targets -- -D warnings now passes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: R Tyler Croy <rtyler@scribd.com>
Signed-off-by: R Tyler Croy <rtyler@scribd.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
async_traitwithdynosauryields perf improvements #17689Rationale for this change
Our MSRV is well past the time when Rust supported async in traits and impls without the async-trait proc macro (1.75 IIRC). I was purging unnecessary dependencies in delta-io/delta-rs and async-trait kept popping back up in analyses slowing build performance, so I figured I would come up to datafusion to remove it and stumbled into @@abhiaagarwal's issue.
I kicked this off to the 🦜 and have reviewed the code, which required touching a lot of callsites to get rid of async-trait.
What changes are included in this PR?
What is the testing strategy for this PR?
Build times are as follows
cargo clean && cargo buiildthis change
main
cargo clean && cargo test --no-runthis change
main
Are there any user-facing changes?
negative ghost rider