Skip to content

chore: Hide internal public utility APIs - #25963

Merged
2010YOUY01 merged 4 commits into
apache:mainfrom
2010YOUY01:hide-internal-util
Oct 10, 2026
Merged

2010YOUY01 merged 4 commits into
apache:mainfrom
2010YOUY01:hide-internal-util

Conversation

@2010YOUY01

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

  • Closes #.

Rationale for this change

See the previous PR for rationale

This PR adds #[doc(hidden)] and comments for public APIs that is used as internal utility.

The major categories are

  • already includes #doc(hidden)
  • Already explained in the comment that this public API is internal-only
  • Optimizer utilities, with strict preconditions to use it correctly.

What changes are included in this PR?

comments only

What is the testing strategy for this PR?

Are there any user-facing changes?

@github-actions github-actions Bot added documentation Improvements or additions to documentation logical-expr Logical plan and expressions physical-expr Changes to the physical-expr crates physical-plan Changes to the physical-plan crate labels Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Thank you for opening this pull request!

Reviewer note: cargo-semver-checks reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch).

Details
     Cloning apache/main
    Building datafusion-expr v55.1.0 (current)
       Built [  28.504s] (current)
     Parsing datafusion-expr v55.1.0 (current)
      Parsed [   0.087s] (current)
    Building datafusion-expr v55.1.0 (baseline)
       Built [  28.459s] (baseline)
     Parsing datafusion-expr v55.1.0 (baseline)
      Parsed [   0.090s] (baseline)
    Checking datafusion-expr v55.1.0 -> v55.1.0 (no change; assume patch)
     Checked [   2.168s] 223 checks: 223 pass, 31 skip
     Summary no semver update required
    Finished [  60.975s] datafusion-expr
    Building datafusion-physical-expr v55.1.0 (current)
       Built [  26.908s] (current)
     Parsing datafusion-physical-expr v55.1.0 (current)
      Parsed [   0.051s] (current)
    Building datafusion-physical-expr v55.1.0 (baseline)
       Built [  26.890s] (baseline)
     Parsing datafusion-physical-expr v55.1.0 (baseline)
      Parsed [   0.051s] (baseline)
    Checking datafusion-physical-expr v55.1.0 -> v55.1.0 (no change; assume patch)
     Checked [   0.499s] 223 checks: 223 pass, 31 skip
     Summary no semver update required
    Finished [  55.735s] datafusion-physical-expr
    Building datafusion-physical-expr-common v55.1.0 (current)
       Built [  22.530s] (current)
     Parsing datafusion-physical-expr-common v55.1.0 (current)
      Parsed [   0.022s] (current)
    Building datafusion-physical-expr-common v55.1.0 (baseline)
       Built [  22.167s] (baseline)
     Parsing datafusion-physical-expr-common v55.1.0 (baseline)
      Parsed [   0.023s] (baseline)
    Checking datafusion-physical-expr-common v55.1.0 -> v55.1.0 (no change; assume patch)
     Checked [   0.332s] 223 checks: 223 pass, 31 skip
     Summary no semver update required
    Finished [  46.102s] datafusion-physical-expr-common
    Building datafusion-physical-plan v55.1.0 (current)
       Built [  35.289s] (current)
     Parsing datafusion-physical-plan v55.1.0 (current)
      Parsed [   0.189s] (current)
    Building datafusion-physical-plan v55.1.0 (baseline)
       Built [  35.051s] (baseline)
     Parsing datafusion-physical-plan v55.1.0 (baseline)
      Parsed [   0.186s] (baseline)
    Checking datafusion-physical-plan v55.1.0 -> v55.1.0 (no change; assume patch)
     Checked [   0.995s] 223 checks: 220 pass, 3 fail, 0 warn, 31 skip

--- failure enum_now_doc_hidden: pub enum is now #[doc(hidden)] ---

Description:
A pub enum is now #[doc(hidden)], removing it from the crate's public API.
        ref: https://doc.rust-lang.org/rustdoc/write-documentation/the-doc-attribute.html#hidden
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/enum_now_doc_hidden.ron

Failed in:
  enum Map in file /home/runner/work/datafusion/datafusion/datafusion/physical-plan/src/joins/mod.rs:89

--- failure inherent_method_now_doc_hidden: inherent method #[doc(hidden)] added ---

Description:
A method or associated fn is now #[doc(hidden)], removing it from the crate's public API.
        ref: https://doc.rust-lang.org/rustdoc/write-documentation/the-doc-attribute.html#hidden
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/inherent_method_now_doc_hidden.ron

Failed in:
  AggregateExec::try_optimize_distinct_soft_limit in file /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/663c27b65ea0f15009428dc1731d61b05806ac9c/datafusion/physical-plan/src/aggregates/mod.rs:1145
  AggregateExec::with_new_aggr_exprs in file /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/663c27b65ea0f15009428dc1731d61b05806ac9c/datafusion/physical-plan/src/aggregates/mod.rs:1170
  CrossJoinExec::swap_inputs in file /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/663c27b65ea0f15009428dc1731d61b05806ac9c/datafusion/physical-plan/src/joins/cross_join.rs:190
  NestedLoopJoinExec::swap_inputs in file /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/663c27b65ea0f15009428dc1731d61b05806ac9c/datafusion/physical-plan/src/joins/nested_loop_join.rs:481
  SortMergeJoinExec::swap_inputs in file /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/663c27b65ea0f15009428dc1731d61b05806ac9c/datafusion/physical-plan/src/joins/sort_merge_join/exec.rs:352
  HashJoinExec::swap_inputs in file /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/663c27b65ea0f15009428dc1731d61b05806ac9c/datafusion/physical-plan/src/joins/hash_join/exec.rs:1499
  SymmetricHashJoinExec::check_if_order_information_available in file /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/663c27b65ea0f15009428dc1731d61b05806ac9c/datafusion/physical-plan/src/joins/symmetric_hash_join.rs:339

--- failure trait_now_doc_hidden: pub trait is now #[doc(hidden)] ---

Description:
A pub trait is now #[doc(hidden)], removing it from the crate's public API.
        ref: https://doc.rust-lang.org/rustdoc/write-documentation/the-doc-attribute.html#hidden
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/trait_now_doc_hidden.ron

Failed in:
  trait JoinHashMapType in file /home/runner/work/datafusion/datafusion/datafusion/physical-plan/src/joins/join_hash_map.rs:110

     Summary semver requires new major version: 3 major and 0 minor checks failed
    Finished [  73.730s] datafusion-physical-plan

@github-actions github-actions Bot added the auto detected api change Auto detected API change label Oct 2, 2026
/// This is not a public API and is for internal use only; see [API policy] for details.
///
/// [API policy]: https://datafusion.apache.org/contributor-guide/api-health.html#internal-public-apis
#[doc(hidden)]

@2010YOUY01 2010YOUY01 Oct 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This API seem like reasonable to be public, however now it requires cooperation from several other optimizer rules, to make it safe. The comments right above can demonstrate it is tricky to use.

Note downstreams can still have access to it, this marker is only a hint for (a) might change often (b) tricky to use it correctly, as explained in the link

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one in particular I would like to maybe add a comment about "might change" or "is tricky to use" if posisble to make it easier to understand the internal marking

@codecov-commenter

codecov-commenter commented Oct 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.77%. Comparing base (e6dfef5) to head (fbbd6e1).
⚠️ Report is 112 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #25963      +/-   ##
==========================================
+ Coverage   82.59%   82.77%   +0.18%     
==========================================
  Files        1145     1148       +3     
  Lines      443934   451075    +7141     
  Branches   443934   451075    +7141     
==========================================
+ Hits       366669   373385    +6716     
+ Misses      55009    54937      -72     
- Partials    22256    22753     +497     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @2010YOUY01

/// - the `predicate` expression is not aliased
/// - the `predicate` expression contains no window function calls
///
/// # Public Only for Internal Use:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in fact the comment above says "for internal use in Datafusion only"

/// This is not a public API and is for internal use only; see [API policy] for details.
///
/// [API policy]: https://datafusion.apache.org/contributor-guide/api-health.html#internal-public-apis
#[doc(hidden)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one in particular I would like to maybe add a comment about "might change" or "is tricky to use" if posisble to make it easier to understand the internal marking

@2010YOUY01

Copy link
Copy Markdown
Contributor Author

@alamb Thank you for the review! Feedbacks addressed.

@2010YOUY01
2010YOUY01 added this pull request to the merge queue Oct 10, 2026
Merged via the queue into apache:main with commit 4e6e564 Oct 10, 2026
43 checks passed
@2010YOUY01
2010YOUY01 deleted the hide-internal-util branch October 10, 2026 02:42
Omega359 pushed a commit to Omega359/arrow-datafusion that referenced this pull request Oct 11, 2026
## Which issue does this PR close?

<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax. For example
`Closes apache#123` indicates that this PR will close issue apache#123.
-->

- Closes #.

## Rationale for this change

<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.

Please explain the problem you are trying to solve in terms of the
user-visible
behavior, rather than the implementation.

For example, "The code in `foo.rs` doesn't handle nulls" is a symptom of
the
implementation. "COUNT(DISTINCT) returns wrong results when the column
contains
nulls" is the user-visible problem.
-->
See the previous PR for rationale

- apache#25495

This PR adds #[doc(hidden)] and comments for public APIs that is used as
internal utility.

The major categories are
- already includes `#doc(hidden)`
- Already explained in the comment that this public API is internal-only
- Optimizer utilities, with strict preconditions to use it correctly.

## What changes are included in this PR?

<!--
There is no need to duplicate the description in the issue here, but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->
comments only

## What is the testing strategy for this PR?

<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

Briefly describe how this PR is tested, and point to the specific tests
you added. For example: 'This new feature is covered by the
`sqllogictest` cases added in `foo.slt`'.

If this PR does not add tests, explain why. For example, if the change
is already covered by existing tests, please mention it.

You should also check the `codecov` bot reply on this PR to confirm the
changed code is exercised.
-->

## Are there any user-facing changes?

<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.

If there are any breaking changes to public APIs, please add the `api
change` label.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto detected api change Auto detected API change documentation Improvements or additions to documentation logical-expr Logical plan and expressions physical-expr Changes to the physical-expr crates physical-plan Changes to the physical-plan crate v56.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants