Export to_datafusion_err from the util crate root#1487
Draft
kosiew wants to merge 3 commits intoapache:mainfrom
Draft
Export to_datafusion_err from the util crate root#1487kosiew wants to merge 3 commits intoapache:mainfrom
to_datafusion_err from the util crate root#1487kosiew wants to merge 3 commits intoapache:mainfrom
Conversation
Publicly re-export curated error helpers, including to_datafusion_err, from the crate root. Add a regression test in crates/util/tests/root_exports.rs to ensure correct functionality in an integration-test context.
Make only to_datafusion_err publicly re-exported from the crate root. Keep PyDataFusionError and PyDataFusionResult as private imports for internal use, enhancing encapsulation and reducing exposure of non-essential components.
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?
Rationale for this change
Users currently cannot import
to_datafusion_errdirectly fromdatafusion_python_util, even though the function is already public inerrors.rs. This creates an inconsistency between the function’s visibility and how consumers expect to access it from the crate root.This change fixes that mismatch by re-exporting
to_datafusion_errfromlib.rs, making the crate’s public API behave as expected and resolving the private item import error reported in the issue.What changes are included in this PR?
This PR makes a small public API cleanup in the
utilcrate:to_datafusion_errfrom the crate root withpub use crate::errors::to_datafusion_err;usestatement inlib.rsso the root re-export and internal imports are separated cleanlycrates/util/tests/root_exports.rsto verify thatto_datafusion_errcan be imported fromdatafusion_python_utilAre these changes tested?
Yes.
This PR adds a regression test,
exports_to_datafusion_err_from_crate_root, which importsto_datafusion_errfromdatafusion_python_utiland verifies that the symbol is available from the crate root. This helps prevent future regressions in the crate’s public exports.Are there any user-facing changes?
Yes.
to_datafusion_erris now importable directly from thedatafusion_python_utilcrate root:This is a small user-facing API improvement, but it is not a breaking change.
LLM-generated code disclosure
This PR includes code, comments generated with assistance from LLM. All LLM-generated content has been manually reviewed and tested.