feat: add serialization test for list element name and metadata support#37
Conversation
Please double check the following review of the pull request:
Changes in the diff
Identified Issues
Issue ID 1ExplanationIn Suggested fixChange the function to return a Code fix examplefn align_struct_values(
values: Vec<arrow::array::ArrayRef>,
fields: &arrow::datatypes::Fields,
) -> Result<Vec<arrow::array::ArrayRef>, arrow::error::ArrowError> {
values
.into_iter()
.zip(fields.iter())
.map(|(value, field)| {
if value.data_type() == field.data_type() {
Ok(value)
} else {
arrow::compute::cast(value.as_ref(), field.data_type()).map_err(|e| {
arrow::error::ArrowError::ComputeError(format!(
"failed to cast field '{}' from {:?} to {:?}: {}",
field.name(),
value.data_type(),
field.data_type(),
e
))
})
}
})
.collect()
}Then update call sites to handle the Explanation of the fixThis change avoids panics and allows the caller to handle errors properly, improving robustness and debuggability. Missing testsThe added test in SummaryThe PR adds a useful test and improves serialization by aligning struct field arrays to expected types. The only recommendation is to avoid panics in Summon me to re-review when updated! Yours, Gooroo.dev |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #37 +/- ##
==========================================
+ Coverage 93.95% 94.03% +0.07%
==========================================
Files 10 10
Lines 2018 2045 +27
==========================================
+ Hits 1896 1923 +27
Misses 122 122 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.