Deprecate PruningPredicate::try_new
Refactored DataFusion pruning predicate construction so new code flows through PruningPredicateBuilder while the older PruningPredicate::try_new API remains as a deprecated compatibility wrapper.
apache/datafusion · #24129
Problem
DataFusion had introduced PruningPredicateBuilder as the extensible construction API, but core construction logic still lived behind PruningPredicate::try_new. That split made future builder options harder to centralize and left examples and call sites pointing at the less extensible constructor.
Approach
Moved pruning predicate construction into PruningPredicateBuilder::try_build, deprecated PruningPredicate::try_new for the 55.0.0 upgrade cycle, migrated DataFusion call sites and examples to the builder, and documented the user-facing API transition.
Impact and scope
- Guides downstream users toward the extensible builder API without breaking existing callers.
- Centralizes pruning predicate construction so future options can be added in one place.
- Keeps DataFusion's parquet pruning, examples, and upgrade documentation aligned with the public API direction.
Validation
- Added a regression test proving the deprecated constructor and builder produce equivalent predicates.
- Validated datafusion-pruning, datasource-parquet, examples, sqllogictests, datafusion, datafusion-cli, rustdoc, formatting, and strict clippy on modified packages.
- Merged after maintainer approvals from alamb and zhuqi-lucas.