Repository navigation
docs(physical-plan): add doctest examples for StatisticsRegistry, ExtendedStatistics, and compute_extended - #25699
Merged
kosiew merged 4 commits intoOct 7, 2026
Conversation
…endedStatistics, and compute_extended Add real, compiled `# Example` doctests to `StatisticsContext::compute_extended`, the `StatisticsRegistry` module doc, and the `ExtendedStatistics` struct doc. The `StatisticsRegistry`/`ExtendedStatistics` examples were previously wrapped in ` ```ignore ` blocks referencing undefined names, so they were never compiled or checked. `compute_extended` had no example at all. The shared running example is a cross-column correlation extension (`ColumnCorrelation`), a real, node-level statistic (unlike a per-column histogram, which has no home in the current single node-level `Extensions` field). Closes apache#25698.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #25699 +/- ##
==========================================
+ Coverage 82.66% 82.70% +0.04%
==========================================
Files 1147 1147
Lines 446357 447631 +1274
Branches 446357 447631 +1274
==========================================
+ Hits 368971 370217 +1246
+ Misses 54997 54924 -73
- Partials 22389 22490 +101 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Prefix the use statements in the compute_extended, StatisticsRegistry, and ExtendedStatistics doctests with # so they compile but do not show in the rendered documentation, per alamb's review on PR apache#25689.
…-statistics-docs # Conflicts: # datafusion/physical-plan/src/statistics.rs
Member
Author
|
@kosiew I wonder if you would be interested into reviewing this, since you were the main reviewer of this code and you have recently touched |
kosiew
approved these changes
Oct 6, 2026
kosiew
left a comment
Contributor
There was a problem hiding this comment.
Thanks for working on this. The doctest coverage looks good, and I did not find any blocking issues. I left one optional documentation suggestion.
…tended doctest Also demonstrates reading the coefficient, not just the column indexes. Addresses kosiew's review suggestion on PR apache#25699.
Contributor
|
🚀 |
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?
Closes #25698.
Rationale for this change
StatisticsRegistryandExtendedStatisticseach had a# Exampledoc block wrapped in```ignore, so it was never compiled or checked bycargo test --doc.StatisticsContext::compute_extendedhad no example at all.What changes are included in this PR?
# ExampletoStatisticsContext::compute_extended.StatisticsRegistrymodule doc example fromignoreto a real doctest.ExtendedStatisticsstruct doc example fromignoreto a real doctest.(
ColumnCorrelation), since it is a genuinely node-level statistic, unlike aper-column histogram, which has no home in the current single node-level
Extensionsfield.Are these changes tested?
Yes, each doc comment is now a doctest, verified by
cargo test --doc.Are there any user-facing changes?
No, this is a documentation-only change to public API doc comments.
Disclaimer: I used AI to assist in the code generation, I have manually reviewed the output and it matches my intention and understanding.