-
Notifications
You must be signed in to change notification settings - Fork 1k
[Variant] Improve documentation and includes for casts #8532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
/// # use arrow::array::{Array, ArrayRef, Int64Array}; | ||
/// # use parquet_variant::Variant; | ||
/// # use parquet_variant_compute::cast_to_variant::cast_to_variant; | ||
/// # use parquet_variant_compute::cast::cast_to_variant; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed this module cast
so that it doesn't have the same name as the function cast_to_variant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but then it doesn't match the convention of shred_variant
and unshred_variant
🤔
//! - [`variant_to_json`]: Function to convert a `VariantArray` to Arrays of JSON strings. | ||
//! - [`cast_to_variant`]: Cast Arrow arrays to `VariantArray`. | ||
//! - [`variant_get`]: Convert `VariantArray` (or an inner path) to ArrowArrays type | ||
//! - [`shred_variant`]: Shred a `VariantArray` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added mention of shred and unshred
mod arrow_to_variant; | ||
pub mod cast_to_variant; | ||
mod cast; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's keep it consistent and not have pub
modules, and instead pub use
the parts of the API explicitly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this one and I ran out of time for today, so I'll try and revisit it tomorrow with a clear head
/// # use arrow::array::{Array, ArrayRef, Int64Array}; | ||
/// # use parquet_variant::Variant; | ||
/// # use parquet_variant_compute::cast_to_variant::cast_to_variant; | ||
/// # use parquet_variant_compute::cast::cast_to_variant; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but then it doesn't match the convention of shred_variant
and unshred_variant
🤔
) # 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. - Closes apache#8531 - Closes apache#8532 # Rationale for this change Basically, I was confused about the casting / conversion functions available so I want to improve the documentation # What changes are included in this PR? 1. Add documentation, improve other docs 2. Remove `pub` crates in favor of exporting only the functions/ structs needed # Are these changes tested? Yes by CI If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? # 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 call them out. --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Ryan Johnson <[email protected]>
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.
Rationale for this change
Basically, I was confused about the casting / conversion functions available so I want to improve the documentation
What changes are included in this PR?
cast_to_variant
module tocast
so there isn't a function with the same nameAre these changes tested?
We typically require tests for all PRs in order to:
If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
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 call them out.