Repository navigation
chore: Hide test-only internal public APIs - #25695
Conversation
| 2. Operator APIs required by the optimizer to inspect or rewrite execution plans | ||
| across crate boundaries. | ||
|
|
||
| Do not expose internal APIs solely for tests or microbenchmarks. Some legacy code |
There was a problem hiding this comment.
This might be subjective, I think it's not a good idea to test or benchmark against implementation details overall. I'm not so sure if there are any special cases that require this pattern.
|
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #25695 +/- ##
==========================================
+ Coverage 82.51% 82.58% +0.06%
==========================================
Files 1141 1145 +4
Lines 439774 443657 +3883
Branches 439774 443657 +3883
==========================================
+ Hits 362896 366385 +3489
- Misses 54939 55019 +80
- Partials 21939 22253 +314 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
alamb
left a comment
There was a problem hiding this comment.
Thanks @2010YOUY01 -- other than the test_utils this looks good to me
| /// [API policy]: https://datafusion.apache.org/contributor-guide/api-health.html#internal-public-apis | ||
| #[macro_export] | ||
| #[doc(hidden)] | ||
| macro_rules! assert_batches_eq { |
There was a problem hiding this comment.
I think we use assert_batches_eq in our tests quite a bit. These days it is probably better to use insta snapshots, but I am not sure claiming this particular API is (no longer) public is accurate
There was a problem hiding this comment.
It makes sense to me, it's possible that downstream is relying on such test utilities
Reverted mod test_utils to public
| /// ); | ||
| /// ``` | ||
| /// | ||
| /// # Public Only for Internal Use: |
There was a problem hiding this comment.
I think it was a public API, but we have now deprecated it 🤔
| /// 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)] |
There was a problem hiding this comment.
I think some of the things in test_utils were actually public (see below) so not sure about this one
| /// 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)] |
| 2. Operator APIs required by the optimizer to inspect or rewrite execution plans | ||
| across crate boundaries. | ||
|
|
||
| Do not expose internal APIs solely for tests or microbenchmarks. Some legacy code |
|
Thanks @2010YOUY01 |
## 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 ratioanle - apache#25495 This PR adds `#[doc(hidden)]` and comments for test-only public APIs Note in the previous PR we've discussed using feature to hide them, but I tried and find it hard to maintain - apache#25678 ## 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. --> ## 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. -->
Which issue does this PR close?
Rationale for this change
See the previous PR for ratioanle
This PR adds
#[doc(hidden)]and comments for test-only public APIsNote in the previous PR we've discussed using feature to hide them, but I tried and find it hard to maintain
test_utilfeature to hide internal public APIs #25678What changes are included in this PR?
What is the testing strategy for this PR?
Are there any user-facing changes?