From 534e7d0267eabcd4fa6fcdb16d16329c822645b0 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 9 Dec 2024 13:06:26 +0100 Subject: [PATCH 1/5] Add ZipValidity --- .../re_types_core/src/arrow_zip_validity.rs | 212 ++++++++++++++++++ crates/store/re_types_core/src/lib.rs | 1 + 2 files changed, 213 insertions(+) create mode 100644 crates/store/re_types_core/src/arrow_zip_validity.rs diff --git a/crates/store/re_types_core/src/arrow_zip_validity.rs b/crates/store/re_types_core/src/arrow_zip_validity.rs new file mode 100644 index 000000000000..20194063b924 --- /dev/null +++ b/crates/store/re_types_core/src/arrow_zip_validity.rs @@ -0,0 +1,212 @@ +//! Easily iterate over arrow values that may contain nulls. +//! +//! Code adapted from +//! Originally written by [Jorge Leitao](https://github.com/jorgecarleitao), +//! under Apache License 2.0 (see `LICENSE-APACHE` file). +//! +//! Adapted by Rerun to work with `arrow` crate. + +use arrow::{buffer::NullBuffer, util::bit_iterator::BitIterator}; + +/// An [`Iterator`] over validity and values. +#[derive(Debug, Clone)] +pub struct ZipValidityIter +where + I: Iterator, + V: Iterator, +{ + values: I, + validity: V, +} + +impl ZipValidityIter +where + I: Iterator, + V: Iterator, +{ + /// Creates a new [`ZipValidityIter`]. + /// # Panics + /// This function panics if the `size_hints` of the iterators are different + pub fn new(values: I, validity: V) -> Self { + assert_eq!(values.size_hint(), validity.size_hint()); + Self { values, validity } + } +} + +impl Iterator for ZipValidityIter +where + I: Iterator, + V: Iterator, +{ + type Item = Option; + + #[inline] + fn next(&mut self) -> Option { + let value = self.values.next(); + let is_valid = self.validity.next(); + is_valid + .zip(value) + .map(|(is_valid, value)| is_valid.then_some(value)) + } + + #[inline] + fn size_hint(&self) -> (usize, Option) { + self.values.size_hint() + } + + #[inline] + fn nth(&mut self, n: usize) -> Option { + let value = self.values.nth(n); + let is_valid = self.validity.nth(n); + is_valid + .zip(value) + .map(|(is_valid, value)| is_valid.then_some(value)) + } +} + +impl DoubleEndedIterator for ZipValidityIter +where + I: DoubleEndedIterator, + V: DoubleEndedIterator, +{ + #[inline] + fn next_back(&mut self) -> Option { + let value = self.values.next_back(); + let is_valid = self.validity.next_back(); + is_valid + .zip(value) + .map(|(is_valid, value)| is_valid.then_some(value)) + } +} + +impl ExactSizeIterator for ZipValidityIter +where + I: ExactSizeIterator, + V: ExactSizeIterator, +{ +} + +/// An [`Iterator`] over [`Option`] +/// This enum can be used in two distinct ways: +/// * as an iterator, via `Iterator::next` +/// * as an enum of two iterators, via `match self` +/// +/// The latter allows specializalizing to when there are no nulls +#[derive(Debug, Clone)] +pub enum ZipValidity +where + I: Iterator, + V: Iterator, +{ + /// There are no null values + Required(I), + + /// There are null values + Optional(ZipValidityIter), +} + +impl ZipValidity +where + I: Iterator, + V: Iterator, +{ + /// Returns a new [`ZipValidity`] + pub fn new(values: I, validity: Option) -> Self { + match validity { + Some(validity) => Self::Optional(ZipValidityIter::new(values, validity)), + _ => Self::Required(values), + } + } +} + +impl<'a, T, I> ZipValidity> +where + I: Iterator, +{ + /// Returns a new [`ZipValidity`] and drops the `validity` if all values + /// are valid. + pub fn new_with_validity(values: I, validity: Option<&'a NullBuffer>) -> Self { + // only if the validity has nulls we take the optional branch. + match validity.and_then(|validity| (validity.null_count() > 0).then(|| validity.iter())) { + Some(validity) => Self::Optional(ZipValidityIter::new(values, validity)), + _ => Self::Required(values), + } + } +} + +impl Iterator for ZipValidity +where + I: Iterator, + V: Iterator, +{ + type Item = Option; + + #[inline] + fn next(&mut self) -> Option { + match self { + Self::Required(values) => values.next().map(Some), + Self::Optional(zipped) => zipped.next(), + } + } + + #[inline] + fn size_hint(&self) -> (usize, Option) { + match self { + Self::Required(values) => values.size_hint(), + Self::Optional(zipped) => zipped.size_hint(), + } + } + + #[inline] + fn nth(&mut self, n: usize) -> Option { + match self { + Self::Required(values) => values.nth(n).map(Some), + Self::Optional(zipped) => zipped.nth(n), + } + } +} + +impl DoubleEndedIterator for ZipValidity +where + I: DoubleEndedIterator, + V: DoubleEndedIterator, +{ + #[inline] + fn next_back(&mut self) -> Option { + match self { + Self::Required(values) => values.next_back().map(Some), + Self::Optional(zipped) => zipped.next_back(), + } + } +} + +impl ExactSizeIterator for ZipValidity +where + I: ExactSizeIterator, + V: ExactSizeIterator, +{ +} + +impl ZipValidity +where + I: Iterator, + V: Iterator, +{ + /// Unwrap into an iterator that has no null values. + pub fn unwrap_required(self) -> I { + if let Self::Required(i) = self { + i + } else { + panic!("Could not 'unwrap_required'. 'ZipValidity' iterator has nulls."); + } + } + + /// Unwrap into an iterator that has null values. + pub fn unwrap_optional(self) -> ZipValidityIter { + if let Self::Optional(i) = self { + i + } else { + panic!("Could not 'unwrap_optional'. 'ZipValidity' iterator has no nulls."); + } + } +} diff --git a/crates/store/re_types_core/src/lib.rs b/crates/store/re_types_core/src/lib.rs index 77ded5215d26..cba7d66cd016 100644 --- a/crates/store/re_types_core/src/lib.rs +++ b/crates/store/re_types_core/src/lib.rs @@ -241,6 +241,7 @@ mod archetype; mod arrow_buffer; pub mod arrow_helpers; mod arrow_string; +pub mod arrow_zip_validity; mod component_descriptor; mod loggable; mod loggable_batch; From 8ffb1e4f58a3a95dfa9271a71ce54d47487994f1 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 9 Dec 2024 16:47:59 +0100 Subject: [PATCH 2/5] Port deserializer to arrow1 --- .../re_types_builder/src/codegen/rust/api.rs | 53 +++++----- .../src/codegen/rust/deserializer.rs | 96 +++++++++---------- 2 files changed, 70 insertions(+), 79 deletions(-) diff --git a/crates/build/re_types_builder/src/codegen/rust/api.rs b/crates/build/re_types_builder/src/codegen/rust/api.rs index 058dce7b7a89..b8f891c40bad 100644 --- a/crates/build/re_types_builder/src/codegen/rust/api.rs +++ b/crates/build/re_types_builder/src/codegen/rust/api.rs @@ -181,7 +181,7 @@ fn generate_object_file( code.push_str("\n\n"); - code.push_str("use ::re_types_core::external::arrow2;\n"); + code.push_str("use ::re_types_core::external::arrow;\n"); code.push_str("use ::re_types_core::SerializationResult;\n"); code.push_str("use ::re_types_core::{DeserializationResult, DeserializationError};\n"); code.push_str("use ::re_types_core::{ComponentDescriptor, ComponentName};\n"); @@ -880,8 +880,8 @@ fn quote_trait_impls_for_datatype_or_component( } }; - let quoted_from_arrow2 = if optimize_for_buffer_slice { - let from_arrow2_body = if let Some(forwarded_type) = forwarded_type.as_ref() { + let quoted_from_arrow = if optimize_for_buffer_slice { + let from_arrow_body = if let Some(forwarded_type) = forwarded_type.as_ref() { let is_pod = obj .try_get_attr::(ATTR_RUST_DERIVE) .map_or(false, |d| d.contains("bytemuck::Pod")) @@ -890,11 +890,11 @@ fn quote_trait_impls_for_datatype_or_component( .map_or(false, |d| d.contains("bytemuck::Pod")); if is_pod { quote! { - #forwarded_type::from_arrow2(arrow_data).map(bytemuck::cast_vec) + #forwarded_type::from_arrow(arrow_data).map(bytemuck::cast_vec) } } else { quote! { - #forwarded_type::from_arrow2(arrow_data).map(|v| v.into_iter().map(Self).collect()) + #forwarded_type::from_arrow(arrow_data).map(|v| v.into_iter().map(Self).collect()) } } } else { @@ -906,14 +906,13 @@ fn quote_trait_impls_for_datatype_or_component( // re_tracing::profile_function!(); #![allow(clippy::wildcard_imports)] - use arrow::datatypes::*; - use arrow2::{ array::*, buffer::*}; - use ::re_types_core::{Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; - // This code-path cannot have null fields. If it does have a validity mask - // all bits must indicate valid data. - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + // This code-path cannot have null fields. + // If it does have a nulls-array, all bits must indicate valid data. + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -924,13 +923,13 @@ fn quote_trait_impls_for_datatype_or_component( quote! { #[inline] - fn from_arrow2( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult> where Self: Sized { - #from_arrow2_body + #from_arrow_body } } } else { @@ -940,7 +939,7 @@ fn quote_trait_impls_for_datatype_or_component( // Forward deserialization to existing datatype if it's transparent. let quoted_deserializer = if let Some(forwarded_type) = forwarded_type.as_ref() { quote! { - #forwarded_type::from_arrow2_opt(arrow_data).map(|v| v.into_iter().map(|v| v.map(Self)).collect()) + #forwarded_type::from_arrow_opt(arrow_data).map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } else { let quoted_deserializer = quote_arrow_deserializer(arrow_registry, objects, obj); @@ -949,9 +948,9 @@ fn quote_trait_impls_for_datatype_or_component( // re_tracing::profile_function!(); #![allow(clippy::wildcard_imports)] - use arrow::datatypes::*; - use arrow2::{ array::*, buffer::*}; - use ::re_types_core::{Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + Ok(#quoted_deserializer) } }; @@ -1019,8 +1018,8 @@ fn quote_trait_impls_for_datatype_or_component( #quoted_serializer // NOTE: Don't inline this, this gets _huge_. - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized @@ -1028,7 +1027,7 @@ fn quote_trait_impls_for_datatype_or_component( #quoted_deserializer } - #quoted_from_arrow2 + #quoted_from_arrow } } } @@ -1227,7 +1226,7 @@ fn quote_trait_impls_for_archetype(obj: &Object) -> TokenStream { quote! { if let Some(array) = arrays_by_name.get(#field_typ_fqname_str) { - <#component>::from_arrow2_opt(&**array) + <#component>::from_arrow_opt(&**array) .with_context(#obj_field_fqname)? #quoted_collection } else { @@ -1238,7 +1237,7 @@ fn quote_trait_impls_for_archetype(obj: &Object) -> TokenStream { quote! { if let Some(array) = arrays_by_name.get(#field_typ_fqname_str) { Some({ - <#component>::from_arrow2_opt(&**array) + <#component>::from_arrow_opt(&**array) .with_context(#obj_field_fqname)? #quoted_collection }) @@ -1253,7 +1252,7 @@ fn quote_trait_impls_for_archetype(obj: &Object) -> TokenStream { .ok_or_else(DeserializationError::missing_data) .with_context(#obj_field_fqname)?; - <#component>::from_arrow2_opt(&**array).with_context(#obj_field_fqname)? #quoted_collection + <#component>::from_arrow_opt(&**array).with_context(#obj_field_fqname)? #quoted_collection }} }; @@ -1323,10 +1322,10 @@ fn quote_trait_impls_for_archetype(obj: &Object) -> TokenStream { } #[inline] - fn from_arrow2_components( + fn from_arrow_components( arrow_data: impl IntoIterator, + arrow::array::ArrayRef, )>, ) -> DeserializationResult { re_tracing::profile_function!(); diff --git a/crates/build/re_types_builder/src/codegen/rust/deserializer.rs b/crates/build/re_types_builder/src/codegen/rust/deserializer.rs index 25880acd6fd0..45fe4925e0f1 100644 --- a/crates/build/re_types_builder/src/codegen/rust/deserializer.rs +++ b/crates/build/re_types_builder/src/codegen/rust/deserializer.rs @@ -18,9 +18,9 @@ use crate::{ /// This short-circuits on error using the `try` (`?`) operator: the outer scope must be one that /// returns a `Result<_, DeserializationError>`! /// -/// There is a 1:1 relationship between `quote_arrow_deserializer` and `Loggable::from_arrow2_opt`: +/// There is a 1:1 relationship between `quote_arrow_deserializer` and `Loggable::from_arrow_opt`: /// ```ignore -/// fn from_arrow2_opt(data: &dyn ::arrow2::array::Array) -> DeserializationResult>> { +/// fn from_arrow_opt(data: &dyn ::arrow::array::Array) -> DeserializationResult>> { /// Ok(#quoted_deserializer) /// } /// ``` @@ -56,7 +56,7 @@ pub fn quote_arrow_deserializer( objects: &Objects, obj: &Object, ) -> TokenStream { - // Runtime identifier of the variable holding the Arrow payload (`&dyn ::arrow2::array::Array`). + // Runtime identifier of the variable holding the Arrow payload (`&dyn ::arrow::array::Array`). let data_src = format_ident!("arrow_data"); let datatype = &arrow_registry.get(&obj.fqname); @@ -236,7 +236,7 @@ pub fn quote_arrow_deserializer( }); let quoted_downcast = { - let cast_as = quote!(arrow2::array::StructArray); + let cast_as = quote!(arrow::array::StructArray); quote_array_downcast(obj_fqname, &data_src, cast_as, "ed_self_datatype) }; quote! {{ @@ -248,19 +248,19 @@ pub fn quote_arrow_deserializer( // datastructures for all of our children. Vec::new() } else { - let (#data_src_fields, #data_src_arrays) = (#data_src.fields(), #data_src.values()); + let (#data_src_fields, #data_src_arrays) = (#data_src.fields(), #data_src.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = #data_src_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(#data_src_arrays) .collect(); #(#quoted_field_deserializers;)* - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( ::itertools::izip!(#(#quoted_field_names),*), - #data_src.validity(), + #data_src.nulls(), ) .map(|opt| opt.map(|(#(#quoted_field_names),*)| Ok(Self { #(#quoted_unwrappings,)* })).transpose()) // NOTE: implicit Vec to Result @@ -274,7 +274,7 @@ pub fn quote_arrow_deserializer( // We use sparse arrow unions for c-style enums, which means only 8 bits is required for each field, // and nulls are encoded with a special 0-index `_null_markers` variant. - let data_src_types = format_ident!("{data_src}_types"); + let data_src_types = format_ident!("{data_src}_type_ids"); let obj_fqname = obj.fqname.as_str(); let quoted_branches = obj.fields.iter().enumerate().map(|(typ, obj_field)| { @@ -287,13 +287,13 @@ pub fn quote_arrow_deserializer( }); let quoted_downcast = { - let cast_as = quote!(arrow2::array::UnionArray); + let cast_as = quote!(arrow::array::UnionArray); quote_array_downcast(obj_fqname, &data_src, &cast_as, "ed_self_datatype) }; quote! {{ let #data_src = #quoted_downcast?; - let #data_src_types = #data_src.types(); + let #data_src_types = #data_src.type_ids(); #data_src_types .iter() @@ -319,8 +319,7 @@ pub fn quote_arrow_deserializer( // We use dense arrow unions for proper sum-type unions. // Nulls are encoded with a special 0-index `_null_markers` variant. - let data_src_types = format_ident!("{data_src}_types"); - let data_src_arrays = format_ident!("{data_src}_arrays"); + let data_src_type_ids = format_ident!("{data_src}_type_ids"); let data_src_offsets = format_ident!("{data_src}_offsets"); let quoted_field_deserializers = obj @@ -349,11 +348,11 @@ pub fn quote_arrow_deserializer( quote! { let #data_dst = { - // NOTE: `data_src_arrays` is a runtime collection of all of the + // NOTE: `data_src` is a runtime collection of all of the // input's payload's union arms, while `#type_id` is our comptime union // arm counter… there's no guarantee it's actually there at // runtime! - if #data_src_arrays.len() <= #type_id { + if #data_src.type_ids().inner().len() <= #type_id { // By not returning an error but rather defaulting to an empty // vector, we introduce some kind of light forwards compatibility: // old clients that don't yet know about the new arms can still @@ -365,8 +364,8 @@ pub fn quote_arrow_deserializer( // )).with_context(#obj_fqname); } - // NOTE: The array indexing is safe: checked above. - let #data_src = &*#data_src_arrays[#type_id]; + // NOTE: indexing is safe: checked above. + let #data_src = #data_src.child(#type_id).as_ref(); #quoted_deserializer.collect::>() } } @@ -417,7 +416,7 @@ pub fn quote_arrow_deserializer( }); let quoted_downcast = { - let cast_as = quote!(arrow2::array::UnionArray); + let cast_as = quote!(arrow::array::UnionArray); quote_array_downcast(obj_fqname, &data_src, &cast_as, "ed_self_datatype) }; @@ -430,7 +429,7 @@ pub fn quote_arrow_deserializer( // datastructures for all of our children. Vec::new() } else { - let (#data_src_types, #data_src_arrays) = (#data_src.types(), #data_src.fields()); + let #data_src_type_ids = #data_src.type_ids(); let #data_src_offsets = #data_src.offsets() // NOTE: expected dense union, got a sparse one instead @@ -440,16 +439,16 @@ pub fn quote_arrow_deserializer( DeserializationError::datatype_mismatch(expected, actual) }).with_context(#obj_fqname)?; - if #data_src_types.len() != #data_src_offsets.len() { + if #data_src_type_ids.len() != #data_src_offsets.len() { // NOTE: need one offset array per union arm! return Err(DeserializationError::offset_slice_oob( - (0, #data_src_types.len()), #data_src_offsets.len(), + (0, #data_src_type_ids.len()), #data_src_offsets.len(), )).with_context(#obj_fqname); } #(#quoted_field_deserializers;)* - #data_src_types + #data_src_type_ids .iter() .enumerate() .map(|(i, typ)| { @@ -495,9 +494,9 @@ enum InnerRepr { /// /// The `datatype` comes from our compile-time Arrow registry, not from the runtime payload! /// If the datatype happens to be a struct or union, this will merely inject a runtime call to -/// `Loggable::from_arrow2_opt` and call it a day, preventing code bloat. +/// `Loggable::from_arrow_opt` and call it a day, preventing code bloat. /// -/// `data_src` is the runtime identifier of the variable holding the Arrow payload (`&dyn ::arrow2::array::Array`). +/// `data_src` is the runtime identifier of the variable holding the Arrow payload (`&dyn ::arrow::array::Array`). /// The returned `TokenStream` always instantiates a `Vec>`. /// /// This short-circuits on error using the `try` (`?`) operator: the outer scope must be one that @@ -509,7 +508,7 @@ fn quote_arrow_field_deserializer( quoted_datatype: &TokenStream, is_nullable: bool, obj_field_fqname: &str, - data_src: &proc_macro2::Ident, // &dyn ::arrow2::array::Array + data_src: &proc_macro2::Ident, // &dyn ::arrow::array::Array inner_repr: InnerRepr, ) -> TokenStream { _ = is_nullable; // not yet used, will be needed very soon @@ -518,7 +517,7 @@ fn quote_arrow_field_deserializer( if let DataType::Extension(fqname, _, _) = datatype { if objects.get(fqname).map_or(false, |obj| obj.is_enum()) { let fqname_use = quote_fqname_as_type_path(fqname); - return quote!(#fqname_use::from_arrow2_opt(#data_src).with_context(#obj_field_fqname)?.into_iter()); + return quote!(#fqname_use::from_arrow_opt(#data_src).with_context(#obj_field_fqname)?.into_iter()); } } @@ -538,11 +537,6 @@ fn quote_arrow_field_deserializer( | DataType::Null => { let quoted_iter_transparency = quote_iterator_transparency(objects, datatype, IteratorKind::OptionValue, None); - let quoted_iter_transparency = if *datatype.to_logical_type() == DataType::Boolean { - quoted_iter_transparency - } else { - quote!(.map(|opt| opt.copied()) #quoted_iter_transparency) - }; let quoted_downcast = { let cast_as = format!("{:?}", datatype.to_logical_type()).replace("DataType::", ""); @@ -565,7 +559,7 @@ fn quote_arrow_field_deserializer( DataType::Utf8 => { let quoted_downcast = { - let cast_as = quote!(arrow2::array::Utf8Array); + let cast_as = quote!(StringArray); quote_array_downcast(obj_field_fqname, data_src, cast_as, quoted_datatype) }; @@ -583,9 +577,9 @@ fn quote_arrow_field_deserializer( let #data_src_buf = #data_src.values(); let offsets = #data_src.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( offsets.windows(2), - #data_src.validity(), + #data_src.nulls(), ) .map(|elem| elem.map(|window| { // NOTE: Do _not_ use `Buffer::sliced`, it panics on malformed inputs. @@ -603,10 +597,8 @@ fn quote_arrow_field_deserializer( (start, end), #data_src_buf.len(), )); } - // Safety: all checked above. - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - // NOTE: The `clone` is a `Buffer::clone`, which is just a refcount bump. - let data = unsafe { #data_src_buf.clone().sliced_unchecked(start, len) }; + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] // TODO: unsafe slice again + let data = #data_src_buf.slice_with_length(start, len); Ok(data) }).transpose() @@ -632,7 +624,7 @@ fn quote_arrow_field_deserializer( ); let quoted_downcast = { - let cast_as = quote!(arrow2::array::FixedSizeListArray); + let cast_as = quote!(arrow::array::FixedSizeListArray); quote_array_downcast(obj_field_fqname, data_src, cast_as, quoted_datatype) }; @@ -662,7 +654,7 @@ fn quote_arrow_field_deserializer( #quoted_inner.collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity(offsets, #data_src.validity()) + ZipValidity::new_with_validity(offsets, #data_src.nulls()) .map(|elem| elem.map(|(start, end): (usize, usize)| { // NOTE: Do _not_ use `Buffer::sliced`, it panics on malformed inputs. @@ -673,7 +665,7 @@ fn quote_arrow_field_deserializer( // NOTE: It is absolutely crucial we explicitly handle the // boundchecks manually first, otherwise rustc completely chokes // when slicing the data (as in: a 100x perf drop)! - if end > #data_src_inner.len() { + if #data_src_inner.len() < end { // error context is appended below during final collection return Err(DeserializationError::offset_slice_oob( (start, end), #data_src_inner.len(), @@ -746,7 +738,7 @@ fn quote_arrow_field_deserializer( ); let quoted_downcast = { - let cast_as = quote!(arrow2::array::ListArray); + let cast_as = quote!(arrow::array::ListArray); quote_array_downcast(obj_field_fqname, data_src, cast_as, quoted_datatype) }; let quoted_collect_inner = match inner_repr { @@ -757,8 +749,8 @@ fn quote_arrow_field_deserializer( let quoted_inner_data_range = match inner_repr { InnerRepr::BufferT => { quote! { - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { #data_src_inner.clone().sliced_unchecked(start, end - start) }; + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] // TODO: unsafe + let data = #data_src_inner.clone().slice(start, end - start); let data = ::re_types_core::ArrowBuffer::from(data); } } @@ -813,9 +805,9 @@ fn quote_arrow_field_deserializer( }; let offsets = #data_src.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( offsets.windows(2), - #data_src.validity(), + #data_src.nulls(), ) .map(|elem| elem.map(|window| { // NOTE: Do _not_ use `Buffer::sliced`, it panics on malformed inputs. @@ -850,7 +842,7 @@ fn quote_arrow_field_deserializer( unreachable!() }; let fqname_use = quote_fqname_as_type_path(fqname); - quote!(#fqname_use::from_arrow2_opt(#data_src).with_context(#obj_field_fqname)?.into_iter()) + quote!(#fqname_use::from_arrow_opt(#data_src).with_context(#obj_field_fqname)?.into_iter()) } _ => unimplemented!("{datatype:#?}"), @@ -994,7 +986,7 @@ fn quote_iterator_transparency( /// /// There is a 1:1 relationship between `quote_arrow_deserializer_buffer_slice` and `Loggable::from_arrow`: /// ```ignore -/// fn from_arrow(data: &dyn ::arrow2::array::Array) -> DeserializationResult> { +/// fn from_arrow(data: &dyn ::arrow::array::Array) -> DeserializationResult> { /// Ok(#quoted_deserializer_) /// } /// ``` @@ -1005,7 +997,7 @@ pub fn quote_arrow_deserializer_buffer_slice( objects: &Objects, obj: &Object, ) -> TokenStream { - // Runtime identifier of the variable holding the Arrow payload (`&dyn ::arrow2::array::Array`). + // Runtime identifier of the variable holding the Arrow payload (`&dyn ::arrow::array::Array`). let data_src = format_ident!("arrow_data"); let datatype = &arrow_registry.get(&obj.fqname); @@ -1077,7 +1069,7 @@ fn quote_arrow_field_deserializer_buffer_slice( datatype: &DataType, is_nullable: bool, obj_field_fqname: &str, - data_src: &proc_macro2::Ident, // &dyn ::arrow2::array::Array + data_src: &proc_macro2::Ident, // &dyn ::arrow::array::Array ) -> TokenStream { _ = is_nullable; // not yet used, will be needed very soon @@ -1107,7 +1099,7 @@ fn quote_arrow_field_deserializer_buffer_slice( quote! { #quoted_downcast? .values() - .as_slice() + .as_ref() } } @@ -1121,7 +1113,7 @@ fn quote_arrow_field_deserializer_buffer_slice( ); let quoted_downcast = { - let cast_as = quote!(arrow2::array::FixedSizeListArray); + let cast_as = quote!(arrow::array::FixedSizeListArray); quote_array_downcast( obj_field_fqname, data_src, From 11d5c4da880f39cd85ee98157c2b1efac93497da Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 9 Dec 2024 18:00:32 +0100 Subject: [PATCH 3/5] codegen --- .../src/archetypes/annotation_context.rs | 8 +- .../store/re_types/src/archetypes/arrows2d.rs | 22 +- .../store/re_types/src/archetypes/arrows3d.rs | 20 +- .../store/re_types/src/archetypes/asset3d.rs | 12 +- .../re_types/src/archetypes/asset_video.rs | 10 +- .../re_types/src/archetypes/bar_chart.rs | 10 +- .../store/re_types/src/archetypes/boxes2d.rs | 22 +- .../store/re_types/src/archetypes/boxes3d.rs | 26 +- .../re_types/src/archetypes/capsules3d.rs | 24 +- .../re_types/src/archetypes/depth_image.rs | 20 +- .../src/archetypes/disconnected_space.rs | 8 +- .../re_types/src/archetypes/ellipsoids3d.rs | 26 +- .../re_types/src/archetypes/encoded_image.rs | 14 +- .../src/archetypes/geo_line_strings.rs | 12 +- .../re_types/src/archetypes/geo_points.rs | 14 +- .../re_types/src/archetypes/graph_edges.rs | 10 +- .../re_types/src/archetypes/graph_nodes.rs | 18 +- crates/store/re_types/src/archetypes/image.rs | 14 +- .../src/archetypes/instance_poses3d.rs | 16 +- .../re_types/src/archetypes/line_strips2d.rs | 20 +- .../re_types/src/archetypes/line_strips3d.rs | 18 +- .../store/re_types/src/archetypes/mesh3d.rs | 24 +- .../store/re_types/src/archetypes/pinhole.rs | 14 +- .../store/re_types/src/archetypes/points2d.rs | 22 +- .../store/re_types/src/archetypes/points3d.rs | 20 +- .../store/re_types/src/archetypes/scalar.rs | 8 +- .../src/archetypes/segmentation_image.rs | 14 +- .../re_types/src/archetypes/series_line.rs | 14 +- .../re_types/src/archetypes/series_point.rs | 14 +- .../store/re_types/src/archetypes/tensor.rs | 10 +- .../re_types/src/archetypes/text_document.rs | 10 +- .../store/re_types/src/archetypes/text_log.rs | 12 +- .../re_types/src/archetypes/transform3d.rs | 20 +- .../src/archetypes/video_frame_reference.rs | 10 +- .../src/archetypes/view_coordinates.rs | 8 +- .../src/blueprint/archetypes/background.rs | 10 +- .../archetypes/container_blueprint.rs | 22 +- .../blueprint/archetypes/dataframe_query.rs | 16 +- .../src/blueprint/archetypes/force_center.rs | 10 +- .../archetypes/force_collision_radius.rs | 12 +- .../src/blueprint/archetypes/force_link.rs | 12 +- .../blueprint/archetypes/force_many_body.rs | 10 +- .../blueprint/archetypes/force_position.rs | 12 +- .../src/blueprint/archetypes/line_grid3d.rs | 16 +- .../blueprint/archetypes/map_background.rs | 8 +- .../src/blueprint/archetypes/map_zoom.rs | 8 +- .../blueprint/archetypes/near_clip_plane.rs | 8 +- .../blueprint/archetypes/panel_blueprint.rs | 8 +- .../src/blueprint/archetypes/plot_legend.rs | 10 +- .../src/blueprint/archetypes/scalar_axis.rs | 10 +- .../archetypes/tensor_scalar_mapping.rs | 12 +- .../archetypes/tensor_slice_selection.rs | 26 +- .../blueprint/archetypes/tensor_view_fit.rs | 8 +- .../blueprint/archetypes/view_blueprint.rs | 14 +- .../src/blueprint/archetypes/view_contents.rs | 8 +- .../archetypes/viewport_blueprint.rs | 16 +- .../archetypes/visible_time_ranges.rs | 8 +- .../blueprint/archetypes/visual_bounds2d.rs | 8 +- .../src/blueprint/components/active_tab.rs | 8 +- .../blueprint/components/apply_latest_at.rs | 8 +- .../src/blueprint/components/auto_layout.rs | 8 +- .../src/blueprint/components/auto_views.rs | 8 +- .../blueprint/components/background_kind.rs | 12 +- .../src/blueprint/components/column_share.rs | 13 +- .../components/component_column_selector.rs | 8 +- .../blueprint/components/container_kind.rs | 12 +- .../src/blueprint/components/corner2d.rs | 12 +- .../src/blueprint/components/enabled.rs | 8 +- .../blueprint/components/filter_by_range.rs | 8 +- .../components/filter_is_not_null.rs | 8 +- .../blueprint/components/force_distance.rs | 13 +- .../blueprint/components/force_iterations.rs | 12 +- .../blueprint/components/force_strength.rs | 13 +- .../src/blueprint/components/grid_columns.rs | 12 +- .../src/blueprint/components/grid_spacing.rs | 13 +- .../blueprint/components/included_content.rs | 8 +- .../src/blueprint/components/interactive.rs | 8 +- .../components/lock_range_during_zoom.rs | 8 +- .../src/blueprint/components/map_provider.rs | 12 +- .../blueprint/components/near_clip_plane.rs | 12 +- .../src/blueprint/components/panel_state.rs | 12 +- .../blueprint/components/query_expression.rs | 8 +- .../blueprint/components/root_container.rs | 12 +- .../src/blueprint/components/row_share.rs | 13 +- .../blueprint/components/selected_columns.rs | 8 +- .../tensor_dimension_index_slider.rs | 8 +- .../src/blueprint/components/timeline_name.rs | 8 +- .../src/blueprint/components/view_class.rs | 8 +- .../src/blueprint/components/view_fit.rs | 12 +- .../blueprint/components/view_maximized.rs | 12 +- .../src/blueprint/components/view_origin.rs | 8 +- .../components/viewer_recommendation_hash.rs | 12 +- .../src/blueprint/components/visible.rs | 8 +- .../components/visible_time_range.rs | 8 +- .../blueprint/components/visual_bounds2d.rs | 8 +- .../components/visualizer_overrides.rs | 8 +- .../src/blueprint/components/zoom_level.rs | 13 +- .../datatypes/component_column_selector.rs | 147 +++-- .../blueprint/datatypes/filter_by_range.rs | 52 +- .../blueprint/datatypes/filter_is_not_null.rs | 29 +- .../blueprint/datatypes/selected_columns.rs | 46 +- .../tensor_dimension_index_slider.rs | 53 +- .../src/blueprint/datatypes/utf8list.rs | 115 ++-- .../src/blueprint/views/bar_chart_view.rs | 2 +- .../src/blueprint/views/dataframe_view.rs | 2 +- .../src/blueprint/views/graph_view.rs | 2 +- .../re_types/src/blueprint/views/map_view.rs | 2 +- .../src/blueprint/views/spatial2d_view.rs | 2 +- .../src/blueprint/views/spatial3d_view.rs | 2 +- .../src/blueprint/views/tensor_view.rs | 2 +- .../src/blueprint/views/text_document_view.rs | 2 +- .../src/blueprint/views/text_log_view.rs | 2 +- .../src/blueprint/views/time_series_view.rs | 2 +- .../src/components/aggregation_policy.rs | 12 +- .../re_types/src/components/albedo_factor.rs | 12 +- .../src/components/annotation_context.rs | 62 +- .../re_types/src/components/axis_length.rs | 13 +- crates/store/re_types/src/components/blob.rs | 8 +- .../store/re_types/src/components/class_id.rs | 12 +- crates/store/re_types/src/components/color.rs | 12 +- .../store/re_types/src/components/colormap.rs | 12 +- .../re_types/src/components/depth_meter.rs | 12 +- .../src/components/disconnected_space.rs | 8 +- .../re_types/src/components/draw_order.rs | 13 +- .../re_types/src/components/entity_path.rs | 8 +- .../re_types/src/components/fill_mode.rs | 12 +- .../re_types/src/components/fill_ratio.rs | 12 +- .../src/components/gamma_correction.rs | 12 +- .../src/components/geo_line_string.rs | 116 ++-- .../re_types/src/components/graph_edge.rs | 8 +- .../re_types/src/components/graph_node.rs | 8 +- .../re_types/src/components/graph_type.rs | 12 +- .../re_types/src/components/half_size2d.rs | 12 +- .../re_types/src/components/half_size3d.rs | 12 +- .../re_types/src/components/image_buffer.rs | 8 +- .../re_types/src/components/image_format.rs | 8 +- .../src/components/image_plane_distance.rs | 13 +- .../re_types/src/components/keypoint_id.rs | 12 +- .../store/re_types/src/components/lat_lon.rs | 12 +- .../store/re_types/src/components/length.rs | 12 +- .../re_types/src/components/line_strip2d.rs | 115 ++-- .../re_types/src/components/line_strip3d.rs | 115 ++-- .../src/components/magnification_filter.rs | 12 +- .../re_types/src/components/marker_shape.rs | 12 +- .../re_types/src/components/marker_size.rs | 12 +- .../re_types/src/components/media_type.rs | 8 +- crates/store/re_types/src/components/name.rs | 8 +- .../store/re_types/src/components/opacity.rs | 12 +- .../src/components/pinhole_projection.rs | 12 +- .../store/re_types/src/components/plane3d.rs | 12 +- .../components/pose_rotation_axis_angle.rs | 8 +- .../src/components/pose_rotation_quat.rs | 12 +- .../re_types/src/components/pose_scale3d.rs | 12 +- .../src/components/pose_transform_mat3x3.rs | 12 +- .../src/components/pose_translation3d.rs | 12 +- .../re_types/src/components/position2d.rs | 12 +- .../re_types/src/components/position3d.rs | 12 +- .../store/re_types/src/components/radius.rs | 12 +- .../store/re_types/src/components/range1d.rs | 12 +- .../re_types/src/components/recording_uri.rs | 8 +- .../re_types/src/components/resolution.rs | 12 +- .../src/components/rotation_axis_angle.rs | 8 +- .../re_types/src/components/rotation_quat.rs | 12 +- .../store/re_types/src/components/scalar.rs | 12 +- .../store/re_types/src/components/scale3d.rs | 12 +- .../re_types/src/components/show_labels.rs | 8 +- .../re_types/src/components/stroke_width.rs | 12 +- .../re_types/src/components/tensor_data.rs | 8 +- .../tensor_dimension_index_selection.rs | 8 +- .../src/components/tensor_height_dimension.rs | 8 +- .../src/components/tensor_width_dimension.rs | 8 +- .../re_types/src/components/texcoord2d.rs | 12 +- crates/store/re_types/src/components/text.rs | 8 +- .../re_types/src/components/text_log_level.rs | 8 +- .../src/components/transform_mat3x3.rs | 12 +- .../src/components/transform_relation.rs | 12 +- .../re_types/src/components/translation3d.rs | 12 +- .../src/components/triangle_indices.rs | 12 +- .../re_types/src/components/value_range.rs | 12 +- .../store/re_types/src/components/vector2d.rs | 12 +- .../store/re_types/src/components/vector3d.rs | 12 +- .../src/components/video_timestamp.rs | 12 +- .../src/components/view_coordinates.rs | 12 +- crates/store/re_types/src/datatypes/angle.rs | 25 +- .../re_types/src/datatypes/annotation_info.rs | 81 ++- crates/store/re_types/src/datatypes/blob.rs | 56 +- .../src/datatypes/channel_datatype.rs | 12 +- .../src/datatypes/class_description.rs | 129 ++-- .../datatypes/class_description_map_elem.rs | 24 +- .../store/re_types/src/datatypes/class_id.rs | 25 +- .../re_types/src/datatypes/color_model.rs | 12 +- crates/store/re_types/src/datatypes/dvec2d.rs | 70 +-- .../re_types/src/datatypes/image_format.rs | 29 +- .../re_types/src/datatypes/keypoint_id.rs | 25 +- .../re_types/src/datatypes/keypoint_pair.rs | 23 +- crates/store/re_types/src/datatypes/mat3x3.rs | 70 +-- crates/store/re_types/src/datatypes/mat4x4.rs | 70 +-- .../re_types/src/datatypes/pixel_format.rs | 12 +- .../store/re_types/src/datatypes/plane3d.rs | 70 +-- .../re_types/src/datatypes/quaternion.rs | 70 +-- .../store/re_types/src/datatypes/range1d.rs | 70 +-- .../store/re_types/src/datatypes/range2d.rs | 131 ++-- crates/store/re_types/src/datatypes/rgba32.rs | 25 +- .../src/datatypes/rotation_axis_angle.rs | 103 ++-- .../re_types/src/datatypes/tensor_buffer.rs | 572 ++++++++---------- .../re_types/src/datatypes/tensor_data.rs | 133 ++-- .../tensor_dimension_index_selection.rs | 23 +- .../datatypes/tensor_dimension_selection.rs | 22 +- .../store/re_types/src/datatypes/utf8pair.rs | 137 ++--- crates/store/re_types/src/datatypes/uuid.rs | 70 +-- crates/store/re_types/src/datatypes/uvec2d.rs | 70 +-- crates/store/re_types/src/datatypes/uvec3d.rs | 70 +-- crates/store/re_types/src/datatypes/uvec4d.rs | 70 +-- crates/store/re_types/src/datatypes/vec2d.rs | 70 +-- crates/store/re_types/src/datatypes/vec3d.rs | 70 +-- crates/store/re_types/src/datatypes/vec4d.rs | 70 +-- .../re_types/src/datatypes/video_timestamp.rs | 25 +- .../src/datatypes/view_coordinates.rs | 70 +-- .../src/testing/archetypes/affix_fuzzer1.rs | 50 +- .../src/testing/archetypes/affix_fuzzer2.rs | 44 +- .../src/testing/archetypes/affix_fuzzer3.rs | 42 +- .../src/testing/archetypes/affix_fuzzer4.rs | 42 +- .../src/testing/components/affix_fuzzer1.rs | 8 +- .../src/testing/components/affix_fuzzer10.rs | 66 +- .../src/testing/components/affix_fuzzer11.rs | 58 +- .../src/testing/components/affix_fuzzer12.rs | 123 ++-- .../src/testing/components/affix_fuzzer13.rs | 123 ++-- .../src/testing/components/affix_fuzzer14.rs | 8 +- .../src/testing/components/affix_fuzzer15.rs | 13 +- .../src/testing/components/affix_fuzzer16.rs | 62 +- .../src/testing/components/affix_fuzzer17.rs | 62 +- .../src/testing/components/affix_fuzzer18.rs | 62 +- .../src/testing/components/affix_fuzzer19.rs | 8 +- .../src/testing/components/affix_fuzzer2.rs | 8 +- .../src/testing/components/affix_fuzzer20.rs | 8 +- .../src/testing/components/affix_fuzzer21.rs | 8 +- .../src/testing/components/affix_fuzzer22.rs | 13 +- .../src/testing/components/affix_fuzzer23.rs | 13 +- .../src/testing/components/affix_fuzzer3.rs | 8 +- .../src/testing/components/affix_fuzzer4.rs | 13 +- .../src/testing/components/affix_fuzzer5.rs | 13 +- .../src/testing/components/affix_fuzzer6.rs | 13 +- .../src/testing/components/affix_fuzzer7.rs | 62 +- .../src/testing/components/affix_fuzzer8.rs | 12 +- .../src/testing/components/affix_fuzzer9.rs | 66 +- .../src/testing/datatypes/affix_fuzzer1.rs | 221 ++++--- .../src/testing/datatypes/affix_fuzzer2.rs | 12 +- .../src/testing/datatypes/affix_fuzzer20.rs | 105 ++-- .../src/testing/datatypes/affix_fuzzer21.rs | 68 +-- .../src/testing/datatypes/affix_fuzzer22.rs | 68 +-- .../src/testing/datatypes/affix_fuzzer3.rs | 98 ++- .../src/testing/datatypes/affix_fuzzer4.rs | 85 ++- .../src/testing/datatypes/affix_fuzzer5.rs | 23 +- .../src/testing/datatypes/enum_test.rs | 12 +- .../src/testing/datatypes/flattened_scalar.rs | 45 +- .../src/testing/datatypes/multi_enum.rs | 25 +- .../testing/datatypes/primitive_component.rs | 25 +- .../src/testing/datatypes/string_component.rs | 64 +- .../src/testing/datatypes/valued_enum.rs | 12 +- .../re_types_core/src/archetypes/clear.rs | 8 +- .../src/components/clear_is_recursive.rs | 8 +- .../store/re_types_core/src/datatypes/bool.rs | 11 +- .../src/datatypes/entity_path.rs | 62 +- .../re_types_core/src/datatypes/float32.rs | 25 +- .../re_types_core/src/datatypes/float64.rs | 25 +- .../re_types_core/src/datatypes/time_int.rs | 25 +- .../re_types_core/src/datatypes/time_range.rs | 52 +- .../src/datatypes/time_range_boundary.rs | 32 +- .../re_types_core/src/datatypes/uint16.rs | 25 +- .../re_types_core/src/datatypes/uint32.rs | 25 +- .../re_types_core/src/datatypes/uint64.rs | 25 +- .../store/re_types_core/src/datatypes/utf8.rs | 62 +- .../src/datatypes/visible_time_range.rs | 80 ++- 273 files changed, 3622 insertions(+), 4113 deletions(-) diff --git a/crates/store/re_types/src/archetypes/annotation_context.rs b/crates/store/re_types/src/archetypes/annotation_context.rs index 8612d3af7624..6fe71ecce50c 100644 --- a/crates/store/re_types/src/archetypes/annotation_context.rs +++ b/crates/store/re_types/src/archetypes/annotation_context.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -160,8 +160,8 @@ impl ::re_types_core::Archetype for AnnotationContext { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -174,7 +174,7 @@ impl ::re_types_core::Archetype for AnnotationContext { .get("rerun.components.AnnotationContext") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.AnnotationContext#context")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.AnnotationContext#context")? .into_iter() .next() diff --git a/crates/store/re_types/src/archetypes/arrows2d.rs b/crates/store/re_types/src/archetypes/arrows2d.rs index 73d077994f4f..e6c9574b375f 100644 --- a/crates/store/re_types/src/archetypes/arrows2d.rs +++ b/crates/store/re_types/src/archetypes/arrows2d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -247,8 +247,8 @@ impl ::re_types_core::Archetype for Arrows2D { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -261,7 +261,7 @@ impl ::re_types_core::Archetype for Arrows2D { .get("rerun.components.Vector2D") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Arrows2D#vectors")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows2D#vectors")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -270,7 +270,7 @@ impl ::re_types_core::Archetype for Arrows2D { }; let origins = if let Some(array) = arrays_by_name.get("rerun.components.Position2D") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows2D#origins")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -282,7 +282,7 @@ impl ::re_types_core::Archetype for Arrows2D { }; let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows2D#radii")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -294,7 +294,7 @@ impl ::re_types_core::Archetype for Arrows2D { }; let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows2D#colors")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -306,7 +306,7 @@ impl ::re_types_core::Archetype for Arrows2D { }; let labels = if let Some(array) = arrays_by_name.get("rerun.components.Text") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows2D#labels")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -317,7 +317,7 @@ impl ::re_types_core::Archetype for Arrows2D { None }; let show_labels = if let Some(array) = arrays_by_name.get("rerun.components.ShowLabels") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows2D#show_labels")? .into_iter() .next() @@ -326,7 +326,7 @@ impl ::re_types_core::Archetype for Arrows2D { None }; let draw_order = if let Some(array) = arrays_by_name.get("rerun.components.DrawOrder") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows2D#draw_order")? .into_iter() .next() @@ -336,7 +336,7 @@ impl ::re_types_core::Archetype for Arrows2D { }; let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows2D#class_ids")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) diff --git a/crates/store/re_types/src/archetypes/arrows3d.rs b/crates/store/re_types/src/archetypes/arrows3d.rs index a6cd1074b5c3..1856f2f47eff 100644 --- a/crates/store/re_types/src/archetypes/arrows3d.rs +++ b/crates/store/re_types/src/archetypes/arrows3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -245,8 +245,8 @@ impl ::re_types_core::Archetype for Arrows3D { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -259,7 +259,7 @@ impl ::re_types_core::Archetype for Arrows3D { .get("rerun.components.Vector3D") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Arrows3D#vectors")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows3D#vectors")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -268,7 +268,7 @@ impl ::re_types_core::Archetype for Arrows3D { }; let origins = if let Some(array) = arrays_by_name.get("rerun.components.Position3D") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows3D#origins")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -280,7 +280,7 @@ impl ::re_types_core::Archetype for Arrows3D { }; let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows3D#radii")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -292,7 +292,7 @@ impl ::re_types_core::Archetype for Arrows3D { }; let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows3D#colors")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -304,7 +304,7 @@ impl ::re_types_core::Archetype for Arrows3D { }; let labels = if let Some(array) = arrays_by_name.get("rerun.components.Text") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows3D#labels")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -315,7 +315,7 @@ impl ::re_types_core::Archetype for Arrows3D { None }; let show_labels = if let Some(array) = arrays_by_name.get("rerun.components.ShowLabels") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows3D#show_labels")? .into_iter() .next() @@ -325,7 +325,7 @@ impl ::re_types_core::Archetype for Arrows3D { }; let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows3D#class_ids")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) diff --git a/crates/store/re_types/src/archetypes/asset3d.rs b/crates/store/re_types/src/archetypes/asset3d.rs index e1381ac13f03..1e66dff861f4 100644 --- a/crates/store/re_types/src/archetypes/asset3d.rs +++ b/crates/store/re_types/src/archetypes/asset3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -186,8 +186,8 @@ impl ::re_types_core::Archetype for Asset3D { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -200,7 +200,7 @@ impl ::re_types_core::Archetype for Asset3D { .get("rerun.components.Blob") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Asset3D#blob")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Asset3D#blob")? .into_iter() .next() @@ -209,7 +209,7 @@ impl ::re_types_core::Archetype for Asset3D { .with_context("rerun.archetypes.Asset3D#blob")? }; let media_type = if let Some(array) = arrays_by_name.get("rerun.components.MediaType") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Asset3D#media_type")? .into_iter() .next() @@ -219,7 +219,7 @@ impl ::re_types_core::Archetype for Asset3D { }; let albedo_factor = if let Some(array) = arrays_by_name.get("rerun.components.AlbedoFactor") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Asset3D#albedo_factor")? .into_iter() .next() diff --git a/crates/store/re_types/src/archetypes/asset_video.rs b/crates/store/re_types/src/archetypes/asset_video.rs index 6d405894be12..52f6efbb5276 100644 --- a/crates/store/re_types/src/archetypes/asset_video.rs +++ b/crates/store/re_types/src/archetypes/asset_video.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -236,8 +236,8 @@ impl ::re_types_core::Archetype for AssetVideo { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -250,7 +250,7 @@ impl ::re_types_core::Archetype for AssetVideo { .get("rerun.components.Blob") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.AssetVideo#blob")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.AssetVideo#blob")? .into_iter() .next() @@ -259,7 +259,7 @@ impl ::re_types_core::Archetype for AssetVideo { .with_context("rerun.archetypes.AssetVideo#blob")? }; let media_type = if let Some(array) = arrays_by_name.get("rerun.components.MediaType") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.AssetVideo#media_type")? .into_iter() .next() diff --git a/crates/store/re_types/src/archetypes/bar_chart.rs b/crates/store/re_types/src/archetypes/bar_chart.rs index 8f5e2157db79..9cc7ea795a03 100644 --- a/crates/store/re_types/src/archetypes/bar_chart.rs +++ b/crates/store/re_types/src/archetypes/bar_chart.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -151,8 +151,8 @@ impl ::re_types_core::Archetype for BarChart { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -165,7 +165,7 @@ impl ::re_types_core::Archetype for BarChart { .get("rerun.components.TensorData") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.BarChart#values")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.BarChart#values")? .into_iter() .next() @@ -174,7 +174,7 @@ impl ::re_types_core::Archetype for BarChart { .with_context("rerun.archetypes.BarChart#values")? }; let color = if let Some(array) = arrays_by_name.get("rerun.components.Color") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.BarChart#color")? .into_iter() .next() diff --git a/crates/store/re_types/src/archetypes/boxes2d.rs b/crates/store/re_types/src/archetypes/boxes2d.rs index e63a42357d97..e0ea1c683159 100644 --- a/crates/store/re_types/src/archetypes/boxes2d.rs +++ b/crates/store/re_types/src/archetypes/boxes2d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -240,8 +240,8 @@ impl ::re_types_core::Archetype for Boxes2D { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -254,7 +254,7 @@ impl ::re_types_core::Archetype for Boxes2D { .get("rerun.components.HalfSize2D") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Boxes2D#half_sizes")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#half_sizes")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -263,7 +263,7 @@ impl ::re_types_core::Archetype for Boxes2D { }; let centers = if let Some(array) = arrays_by_name.get("rerun.components.Position2D") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#centers")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -275,7 +275,7 @@ impl ::re_types_core::Archetype for Boxes2D { }; let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#colors")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -287,7 +287,7 @@ impl ::re_types_core::Archetype for Boxes2D { }; let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#radii")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -299,7 +299,7 @@ impl ::re_types_core::Archetype for Boxes2D { }; let labels = if let Some(array) = arrays_by_name.get("rerun.components.Text") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#labels")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -310,7 +310,7 @@ impl ::re_types_core::Archetype for Boxes2D { None }; let show_labels = if let Some(array) = arrays_by_name.get("rerun.components.ShowLabels") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#show_labels")? .into_iter() .next() @@ -319,7 +319,7 @@ impl ::re_types_core::Archetype for Boxes2D { None }; let draw_order = if let Some(array) = arrays_by_name.get("rerun.components.DrawOrder") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#draw_order")? .into_iter() .next() @@ -329,7 +329,7 @@ impl ::re_types_core::Archetype for Boxes2D { }; let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#class_ids")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) diff --git a/crates/store/re_types/src/archetypes/boxes3d.rs b/crates/store/re_types/src/archetypes/boxes3d.rs index f0b2d929212e..ffdaf5f494fa 100644 --- a/crates/store/re_types/src/archetypes/boxes3d.rs +++ b/crates/store/re_types/src/archetypes/boxes3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -290,8 +290,8 @@ impl ::re_types_core::Archetype for Boxes3D { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -304,7 +304,7 @@ impl ::re_types_core::Archetype for Boxes3D { .get("rerun.components.HalfSize3D") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Boxes3D#half_sizes")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#half_sizes")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -314,7 +314,7 @@ impl ::re_types_core::Archetype for Boxes3D { let centers = if let Some(array) = arrays_by_name.get("rerun.components.PoseTranslation3D") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#centers")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -327,7 +327,7 @@ impl ::re_types_core::Archetype for Boxes3D { let rotation_axis_angles = if let Some(array) = arrays_by_name.get("rerun.components.PoseRotationAxisAngle") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#rotation_axis_angles")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -340,7 +340,7 @@ impl ::re_types_core::Archetype for Boxes3D { let quaternions = if let Some(array) = arrays_by_name.get("rerun.components.PoseRotationQuat") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#quaternions")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -352,7 +352,7 @@ impl ::re_types_core::Archetype for Boxes3D { }; let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#colors")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -364,7 +364,7 @@ impl ::re_types_core::Archetype for Boxes3D { }; let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#radii")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -375,7 +375,7 @@ impl ::re_types_core::Archetype for Boxes3D { None }; let fill_mode = if let Some(array) = arrays_by_name.get("rerun.components.FillMode") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#fill_mode")? .into_iter() .next() @@ -385,7 +385,7 @@ impl ::re_types_core::Archetype for Boxes3D { }; let labels = if let Some(array) = arrays_by_name.get("rerun.components.Text") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#labels")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -396,7 +396,7 @@ impl ::re_types_core::Archetype for Boxes3D { None }; let show_labels = if let Some(array) = arrays_by_name.get("rerun.components.ShowLabels") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#show_labels")? .into_iter() .next() @@ -406,7 +406,7 @@ impl ::re_types_core::Archetype for Boxes3D { }; let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#class_ids")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) diff --git a/crates/store/re_types/src/archetypes/capsules3d.rs b/crates/store/re_types/src/archetypes/capsules3d.rs index 7e5cb90368b7..36d48b2782ac 100644 --- a/crates/store/re_types/src/archetypes/capsules3d.rs +++ b/crates/store/re_types/src/archetypes/capsules3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -284,8 +284,8 @@ impl ::re_types_core::Archetype for Capsules3D { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -298,7 +298,7 @@ impl ::re_types_core::Archetype for Capsules3D { .get("rerun.components.Length") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Capsules3D#lengths")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Capsules3D#lengths")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -310,7 +310,7 @@ impl ::re_types_core::Archetype for Capsules3D { .get("rerun.components.Radius") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Capsules3D#radii")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Capsules3D#radii")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -320,7 +320,7 @@ impl ::re_types_core::Archetype for Capsules3D { let translations = if let Some(array) = arrays_by_name.get("rerun.components.PoseTranslation3D") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Capsules3D#translations")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -333,7 +333,7 @@ impl ::re_types_core::Archetype for Capsules3D { let rotation_axis_angles = if let Some(array) = arrays_by_name.get("rerun.components.PoseRotationAxisAngle") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Capsules3D#rotation_axis_angles")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -346,7 +346,7 @@ impl ::re_types_core::Archetype for Capsules3D { let quaternions = if let Some(array) = arrays_by_name.get("rerun.components.PoseRotationQuat") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Capsules3D#quaternions")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -358,7 +358,7 @@ impl ::re_types_core::Archetype for Capsules3D { }; let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Capsules3D#colors")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -370,7 +370,7 @@ impl ::re_types_core::Archetype for Capsules3D { }; let labels = if let Some(array) = arrays_by_name.get("rerun.components.Text") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Capsules3D#labels")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -381,7 +381,7 @@ impl ::re_types_core::Archetype for Capsules3D { None }; let show_labels = if let Some(array) = arrays_by_name.get("rerun.components.ShowLabels") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Capsules3D#show_labels")? .into_iter() .next() @@ -391,7 +391,7 @@ impl ::re_types_core::Archetype for Capsules3D { }; let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Capsules3D#class_ids")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) diff --git a/crates/store/re_types/src/archetypes/depth_image.rs b/crates/store/re_types/src/archetypes/depth_image.rs index fcaa8f20b1b7..e1c1a0b4888c 100644 --- a/crates/store/re_types/src/archetypes/depth_image.rs +++ b/crates/store/re_types/src/archetypes/depth_image.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -264,8 +264,8 @@ impl ::re_types_core::Archetype for DepthImage { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -278,7 +278,7 @@ impl ::re_types_core::Archetype for DepthImage { .get("rerun.components.ImageBuffer") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.DepthImage#buffer")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.DepthImage#buffer")? .into_iter() .next() @@ -291,7 +291,7 @@ impl ::re_types_core::Archetype for DepthImage { .get("rerun.components.ImageFormat") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.DepthImage#format")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.DepthImage#format")? .into_iter() .next() @@ -300,7 +300,7 @@ impl ::re_types_core::Archetype for DepthImage { .with_context("rerun.archetypes.DepthImage#format")? }; let meter = if let Some(array) = arrays_by_name.get("rerun.components.DepthMeter") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.DepthImage#meter")? .into_iter() .next() @@ -309,7 +309,7 @@ impl ::re_types_core::Archetype for DepthImage { None }; let colormap = if let Some(array) = arrays_by_name.get("rerun.components.Colormap") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.DepthImage#colormap")? .into_iter() .next() @@ -318,7 +318,7 @@ impl ::re_types_core::Archetype for DepthImage { None }; let depth_range = if let Some(array) = arrays_by_name.get("rerun.components.ValueRange") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.DepthImage#depth_range")? .into_iter() .next() @@ -328,7 +328,7 @@ impl ::re_types_core::Archetype for DepthImage { }; let point_fill_ratio = if let Some(array) = arrays_by_name.get("rerun.components.FillRatio") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.DepthImage#point_fill_ratio")? .into_iter() .next() @@ -337,7 +337,7 @@ impl ::re_types_core::Archetype for DepthImage { None }; let draw_order = if let Some(array) = arrays_by_name.get("rerun.components.DrawOrder") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.DepthImage#draw_order")? .into_iter() .next() diff --git a/crates/store/re_types/src/archetypes/disconnected_space.rs b/crates/store/re_types/src/archetypes/disconnected_space.rs index 642694071edc..f6658b6101ad 100644 --- a/crates/store/re_types/src/archetypes/disconnected_space.rs +++ b/crates/store/re_types/src/archetypes/disconnected_space.rs @@ -13,7 +13,7 @@ #![allow(clippy::too_many_lines)] #![allow(deprecated)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -158,8 +158,8 @@ impl ::re_types_core::Archetype for DisconnectedSpace { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -172,7 +172,7 @@ impl ::re_types_core::Archetype for DisconnectedSpace { .get("rerun.components.DisconnectedSpace") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.DisconnectedSpace#disconnected_space")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.DisconnectedSpace#disconnected_space")? .into_iter() .next() diff --git a/crates/store/re_types/src/archetypes/ellipsoids3d.rs b/crates/store/re_types/src/archetypes/ellipsoids3d.rs index bc6ee14a53f6..111485b9177e 100644 --- a/crates/store/re_types/src/archetypes/ellipsoids3d.rs +++ b/crates/store/re_types/src/archetypes/ellipsoids3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -253,8 +253,8 @@ impl ::re_types_core::Archetype for Ellipsoids3D { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -267,7 +267,7 @@ impl ::re_types_core::Archetype for Ellipsoids3D { .get("rerun.components.HalfSize3D") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Ellipsoids3D#half_sizes")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Ellipsoids3D#half_sizes")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -277,7 +277,7 @@ impl ::re_types_core::Archetype for Ellipsoids3D { let centers = if let Some(array) = arrays_by_name.get("rerun.components.PoseTranslation3D") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Ellipsoids3D#centers")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -290,7 +290,7 @@ impl ::re_types_core::Archetype for Ellipsoids3D { let rotation_axis_angles = if let Some(array) = arrays_by_name.get("rerun.components.PoseRotationAxisAngle") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Ellipsoids3D#rotation_axis_angles")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -303,7 +303,7 @@ impl ::re_types_core::Archetype for Ellipsoids3D { let quaternions = if let Some(array) = arrays_by_name.get("rerun.components.PoseRotationQuat") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Ellipsoids3D#quaternions")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -315,7 +315,7 @@ impl ::re_types_core::Archetype for Ellipsoids3D { }; let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Ellipsoids3D#colors")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -327,7 +327,7 @@ impl ::re_types_core::Archetype for Ellipsoids3D { }; let line_radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Ellipsoids3D#line_radii")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -338,7 +338,7 @@ impl ::re_types_core::Archetype for Ellipsoids3D { None }; let fill_mode = if let Some(array) = arrays_by_name.get("rerun.components.FillMode") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Ellipsoids3D#fill_mode")? .into_iter() .next() @@ -348,7 +348,7 @@ impl ::re_types_core::Archetype for Ellipsoids3D { }; let labels = if let Some(array) = arrays_by_name.get("rerun.components.Text") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Ellipsoids3D#labels")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -359,7 +359,7 @@ impl ::re_types_core::Archetype for Ellipsoids3D { None }; let show_labels = if let Some(array) = arrays_by_name.get("rerun.components.ShowLabels") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Ellipsoids3D#show_labels")? .into_iter() .next() @@ -369,7 +369,7 @@ impl ::re_types_core::Archetype for Ellipsoids3D { }; let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Ellipsoids3D#class_ids")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) diff --git a/crates/store/re_types/src/archetypes/encoded_image.rs b/crates/store/re_types/src/archetypes/encoded_image.rs index c415be42a437..63cf147063b2 100644 --- a/crates/store/re_types/src/archetypes/encoded_image.rs +++ b/crates/store/re_types/src/archetypes/encoded_image.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -186,8 +186,8 @@ impl ::re_types_core::Archetype for EncodedImage { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -200,7 +200,7 @@ impl ::re_types_core::Archetype for EncodedImage { .get("rerun.components.Blob") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.EncodedImage#blob")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.EncodedImage#blob")? .into_iter() .next() @@ -209,7 +209,7 @@ impl ::re_types_core::Archetype for EncodedImage { .with_context("rerun.archetypes.EncodedImage#blob")? }; let media_type = if let Some(array) = arrays_by_name.get("rerun.components.MediaType") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.EncodedImage#media_type")? .into_iter() .next() @@ -218,7 +218,7 @@ impl ::re_types_core::Archetype for EncodedImage { None }; let opacity = if let Some(array) = arrays_by_name.get("rerun.components.Opacity") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.EncodedImage#opacity")? .into_iter() .next() @@ -227,7 +227,7 @@ impl ::re_types_core::Archetype for EncodedImage { None }; let draw_order = if let Some(array) = arrays_by_name.get("rerun.components.DrawOrder") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.EncodedImage#draw_order")? .into_iter() .next() diff --git a/crates/store/re_types/src/archetypes/geo_line_strings.rs b/crates/store/re_types/src/archetypes/geo_line_strings.rs index 341616ee2eb3..06b4fb41e095 100644 --- a/crates/store/re_types/src/archetypes/geo_line_strings.rs +++ b/crates/store/re_types/src/archetypes/geo_line_strings.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -176,8 +176,8 @@ impl ::re_types_core::Archetype for GeoLineStrings { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -190,7 +190,7 @@ impl ::re_types_core::Archetype for GeoLineStrings { .get("rerun.components.GeoLineString") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.GeoLineStrings#line_strings")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GeoLineStrings#line_strings")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -199,7 +199,7 @@ impl ::re_types_core::Archetype for GeoLineStrings { }; let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GeoLineStrings#radii")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -211,7 +211,7 @@ impl ::re_types_core::Archetype for GeoLineStrings { }; let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GeoLineStrings#colors")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) diff --git a/crates/store/re_types/src/archetypes/geo_points.rs b/crates/store/re_types/src/archetypes/geo_points.rs index 1051801f5767..5d109634d447 100644 --- a/crates/store/re_types/src/archetypes/geo_points.rs +++ b/crates/store/re_types/src/archetypes/geo_points.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -183,8 +183,8 @@ impl ::re_types_core::Archetype for GeoPoints { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -197,7 +197,7 @@ impl ::re_types_core::Archetype for GeoPoints { .get("rerun.components.LatLon") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.GeoPoints#positions")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GeoPoints#positions")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -206,7 +206,7 @@ impl ::re_types_core::Archetype for GeoPoints { }; let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GeoPoints#radii")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -218,7 +218,7 @@ impl ::re_types_core::Archetype for GeoPoints { }; let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GeoPoints#colors")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -230,7 +230,7 @@ impl ::re_types_core::Archetype for GeoPoints { }; let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GeoPoints#class_ids")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) diff --git a/crates/store/re_types/src/archetypes/graph_edges.rs b/crates/store/re_types/src/archetypes/graph_edges.rs index d30dfea19a76..42c20574d675 100644 --- a/crates/store/re_types/src/archetypes/graph_edges.rs +++ b/crates/store/re_types/src/archetypes/graph_edges.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -161,8 +161,8 @@ impl ::re_types_core::Archetype for GraphEdges { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -175,7 +175,7 @@ impl ::re_types_core::Archetype for GraphEdges { .get("rerun.components.GraphEdge") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.GraphEdges#edges")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GraphEdges#edges")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -183,7 +183,7 @@ impl ::re_types_core::Archetype for GraphEdges { .with_context("rerun.archetypes.GraphEdges#edges")? }; let graph_type = if let Some(array) = arrays_by_name.get("rerun.components.GraphType") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GraphEdges#graph_type")? .into_iter() .next() diff --git a/crates/store/re_types/src/archetypes/graph_nodes.rs b/crates/store/re_types/src/archetypes/graph_nodes.rs index 3f3e707e185f..34968e1a25b3 100644 --- a/crates/store/re_types/src/archetypes/graph_nodes.rs +++ b/crates/store/re_types/src/archetypes/graph_nodes.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -210,8 +210,8 @@ impl ::re_types_core::Archetype for GraphNodes { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -224,7 +224,7 @@ impl ::re_types_core::Archetype for GraphNodes { .get("rerun.components.GraphNode") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.GraphNodes#node_ids")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GraphNodes#node_ids")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -233,7 +233,7 @@ impl ::re_types_core::Archetype for GraphNodes { }; let positions = if let Some(array) = arrays_by_name.get("rerun.components.Position2D") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GraphNodes#positions")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -245,7 +245,7 @@ impl ::re_types_core::Archetype for GraphNodes { }; let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GraphNodes#colors")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -257,7 +257,7 @@ impl ::re_types_core::Archetype for GraphNodes { }; let labels = if let Some(array) = arrays_by_name.get("rerun.components.Text") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GraphNodes#labels")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -268,7 +268,7 @@ impl ::re_types_core::Archetype for GraphNodes { None }; let show_labels = if let Some(array) = arrays_by_name.get("rerun.components.ShowLabels") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GraphNodes#show_labels")? .into_iter() .next() @@ -278,7 +278,7 @@ impl ::re_types_core::Archetype for GraphNodes { }; let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GraphNodes#radii")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) diff --git a/crates/store/re_types/src/archetypes/image.rs b/crates/store/re_types/src/archetypes/image.rs index 523f26001142..80fb93450525 100644 --- a/crates/store/re_types/src/archetypes/image.rs +++ b/crates/store/re_types/src/archetypes/image.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -265,8 +265,8 @@ impl ::re_types_core::Archetype for Image { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -279,7 +279,7 @@ impl ::re_types_core::Archetype for Image { .get("rerun.components.ImageBuffer") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Image#buffer")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Image#buffer")? .into_iter() .next() @@ -292,7 +292,7 @@ impl ::re_types_core::Archetype for Image { .get("rerun.components.ImageFormat") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Image#format")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Image#format")? .into_iter() .next() @@ -301,7 +301,7 @@ impl ::re_types_core::Archetype for Image { .with_context("rerun.archetypes.Image#format")? }; let opacity = if let Some(array) = arrays_by_name.get("rerun.components.Opacity") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Image#opacity")? .into_iter() .next() @@ -310,7 +310,7 @@ impl ::re_types_core::Archetype for Image { None }; let draw_order = if let Some(array) = arrays_by_name.get("rerun.components.DrawOrder") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Image#draw_order")? .into_iter() .next() diff --git a/crates/store/re_types/src/archetypes/instance_poses3d.rs b/crates/store/re_types/src/archetypes/instance_poses3d.rs index fd99a27f18ea..0f251cb34ddb 100644 --- a/crates/store/re_types/src/archetypes/instance_poses3d.rs +++ b/crates/store/re_types/src/archetypes/instance_poses3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -235,8 +235,8 @@ impl ::re_types_core::Archetype for InstancePoses3D { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -247,7 +247,7 @@ impl ::re_types_core::Archetype for InstancePoses3D { let translations = if let Some(array) = arrays_by_name.get("rerun.components.PoseTranslation3D") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.InstancePoses3D#translations")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -260,7 +260,7 @@ impl ::re_types_core::Archetype for InstancePoses3D { let rotation_axis_angles = if let Some(array) = arrays_by_name.get("rerun.components.PoseRotationAxisAngle") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.InstancePoses3D#rotation_axis_angles")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -273,7 +273,7 @@ impl ::re_types_core::Archetype for InstancePoses3D { let quaternions = if let Some(array) = arrays_by_name.get("rerun.components.PoseRotationQuat") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.InstancePoses3D#quaternions")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -285,7 +285,7 @@ impl ::re_types_core::Archetype for InstancePoses3D { }; let scales = if let Some(array) = arrays_by_name.get("rerun.components.PoseScale3D") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.InstancePoses3D#scales")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -298,7 +298,7 @@ impl ::re_types_core::Archetype for InstancePoses3D { let mat3x3 = if let Some(array) = arrays_by_name.get("rerun.components.PoseTransformMat3x3") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.InstancePoses3D#mat3x3")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) diff --git a/crates/store/re_types/src/archetypes/line_strips2d.rs b/crates/store/re_types/src/archetypes/line_strips2d.rs index 657ffd47d1e3..595afb313aeb 100644 --- a/crates/store/re_types/src/archetypes/line_strips2d.rs +++ b/crates/store/re_types/src/archetypes/line_strips2d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -266,8 +266,8 @@ impl ::re_types_core::Archetype for LineStrips2D { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -280,7 +280,7 @@ impl ::re_types_core::Archetype for LineStrips2D { .get("rerun.components.LineStrip2D") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.LineStrips2D#strips")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips2D#strips")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -289,7 +289,7 @@ impl ::re_types_core::Archetype for LineStrips2D { }; let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips2D#radii")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -301,7 +301,7 @@ impl ::re_types_core::Archetype for LineStrips2D { }; let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips2D#colors")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -313,7 +313,7 @@ impl ::re_types_core::Archetype for LineStrips2D { }; let labels = if let Some(array) = arrays_by_name.get("rerun.components.Text") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips2D#labels")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -324,7 +324,7 @@ impl ::re_types_core::Archetype for LineStrips2D { None }; let show_labels = if let Some(array) = arrays_by_name.get("rerun.components.ShowLabels") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips2D#show_labels")? .into_iter() .next() @@ -333,7 +333,7 @@ impl ::re_types_core::Archetype for LineStrips2D { None }; let draw_order = if let Some(array) = arrays_by_name.get("rerun.components.DrawOrder") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips2D#draw_order")? .into_iter() .next() @@ -343,7 +343,7 @@ impl ::re_types_core::Archetype for LineStrips2D { }; let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips2D#class_ids")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) diff --git a/crates/store/re_types/src/archetypes/line_strips3d.rs b/crates/store/re_types/src/archetypes/line_strips3d.rs index 3bca90b8753f..c046ab3c455b 100644 --- a/crates/store/re_types/src/archetypes/line_strips3d.rs +++ b/crates/store/re_types/src/archetypes/line_strips3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -264,8 +264,8 @@ impl ::re_types_core::Archetype for LineStrips3D { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -278,7 +278,7 @@ impl ::re_types_core::Archetype for LineStrips3D { .get("rerun.components.LineStrip3D") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.LineStrips3D#strips")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips3D#strips")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -287,7 +287,7 @@ impl ::re_types_core::Archetype for LineStrips3D { }; let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips3D#radii")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -299,7 +299,7 @@ impl ::re_types_core::Archetype for LineStrips3D { }; let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips3D#colors")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -311,7 +311,7 @@ impl ::re_types_core::Archetype for LineStrips3D { }; let labels = if let Some(array) = arrays_by_name.get("rerun.components.Text") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips3D#labels")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -322,7 +322,7 @@ impl ::re_types_core::Archetype for LineStrips3D { None }; let show_labels = if let Some(array) = arrays_by_name.get("rerun.components.ShowLabels") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips3D#show_labels")? .into_iter() .next() @@ -332,7 +332,7 @@ impl ::re_types_core::Archetype for LineStrips3D { }; let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips3D#class_ids")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) diff --git a/crates/store/re_types/src/archetypes/mesh3d.rs b/crates/store/re_types/src/archetypes/mesh3d.rs index e4a7d8528a09..a1b8c3f2873c 100644 --- a/crates/store/re_types/src/archetypes/mesh3d.rs +++ b/crates/store/re_types/src/archetypes/mesh3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -315,8 +315,8 @@ impl ::re_types_core::Archetype for Mesh3D { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -329,7 +329,7 @@ impl ::re_types_core::Archetype for Mesh3D { .get("rerun.components.Position3D") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Mesh3D#vertex_positions")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Mesh3D#vertex_positions")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -339,7 +339,7 @@ impl ::re_types_core::Archetype for Mesh3D { let triangle_indices = if let Some(array) = arrays_by_name.get("rerun.components.TriangleIndices") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Mesh3D#triangle_indices")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -351,7 +351,7 @@ impl ::re_types_core::Archetype for Mesh3D { }; let vertex_normals = if let Some(array) = arrays_by_name.get("rerun.components.Vector3D") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Mesh3D#vertex_normals")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -363,7 +363,7 @@ impl ::re_types_core::Archetype for Mesh3D { }; let vertex_colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Mesh3D#vertex_colors")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -376,7 +376,7 @@ impl ::re_types_core::Archetype for Mesh3D { let vertex_texcoords = if let Some(array) = arrays_by_name.get("rerun.components.Texcoord2D") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Mesh3D#vertex_texcoords")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -388,7 +388,7 @@ impl ::re_types_core::Archetype for Mesh3D { }; let albedo_factor = if let Some(array) = arrays_by_name.get("rerun.components.AlbedoFactor") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Mesh3D#albedo_factor")? .into_iter() .next() @@ -398,7 +398,7 @@ impl ::re_types_core::Archetype for Mesh3D { }; let albedo_texture_buffer = if let Some(array) = arrays_by_name.get("rerun.components.ImageBuffer") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Mesh3D#albedo_texture_buffer")? .into_iter() .next() @@ -408,7 +408,7 @@ impl ::re_types_core::Archetype for Mesh3D { }; let albedo_texture_format = if let Some(array) = arrays_by_name.get("rerun.components.ImageFormat") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Mesh3D#albedo_texture_format")? .into_iter() .next() @@ -418,7 +418,7 @@ impl ::re_types_core::Archetype for Mesh3D { }; let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Mesh3D#class_ids")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) diff --git a/crates/store/re_types/src/archetypes/pinhole.rs b/crates/store/re_types/src/archetypes/pinhole.rs index 23dc3ee1c755..d35449361cb4 100644 --- a/crates/store/re_types/src/archetypes/pinhole.rs +++ b/crates/store/re_types/src/archetypes/pinhole.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -256,8 +256,8 @@ impl ::re_types_core::Archetype for Pinhole { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -270,7 +270,7 @@ impl ::re_types_core::Archetype for Pinhole { .get("rerun.components.PinholeProjection") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Pinhole#image_from_camera")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Pinhole#image_from_camera")? .into_iter() .next() @@ -279,7 +279,7 @@ impl ::re_types_core::Archetype for Pinhole { .with_context("rerun.archetypes.Pinhole#image_from_camera")? }; let resolution = if let Some(array) = arrays_by_name.get("rerun.components.Resolution") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Pinhole#resolution")? .into_iter() .next() @@ -289,7 +289,7 @@ impl ::re_types_core::Archetype for Pinhole { }; let camera_xyz = if let Some(array) = arrays_by_name.get("rerun.components.ViewCoordinates") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Pinhole#camera_xyz")? .into_iter() .next() @@ -299,7 +299,7 @@ impl ::re_types_core::Archetype for Pinhole { }; let image_plane_distance = if let Some(array) = arrays_by_name.get("rerun.components.ImagePlaneDistance") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Pinhole#image_plane_distance")? .into_iter() .next() diff --git a/crates/store/re_types/src/archetypes/points2d.rs b/crates/store/re_types/src/archetypes/points2d.rs index 8b8cbf318a53..662d70f8d841 100644 --- a/crates/store/re_types/src/archetypes/points2d.rs +++ b/crates/store/re_types/src/archetypes/points2d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -297,8 +297,8 @@ impl ::re_types_core::Archetype for Points2D { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -311,7 +311,7 @@ impl ::re_types_core::Archetype for Points2D { .get("rerun.components.Position2D") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Points2D#positions")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points2D#positions")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -320,7 +320,7 @@ impl ::re_types_core::Archetype for Points2D { }; let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points2D#radii")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -332,7 +332,7 @@ impl ::re_types_core::Archetype for Points2D { }; let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points2D#colors")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -344,7 +344,7 @@ impl ::re_types_core::Archetype for Points2D { }; let labels = if let Some(array) = arrays_by_name.get("rerun.components.Text") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points2D#labels")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -355,7 +355,7 @@ impl ::re_types_core::Archetype for Points2D { None }; let show_labels = if let Some(array) = arrays_by_name.get("rerun.components.ShowLabels") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points2D#show_labels")? .into_iter() .next() @@ -364,7 +364,7 @@ impl ::re_types_core::Archetype for Points2D { None }; let draw_order = if let Some(array) = arrays_by_name.get("rerun.components.DrawOrder") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points2D#draw_order")? .into_iter() .next() @@ -374,7 +374,7 @@ impl ::re_types_core::Archetype for Points2D { }; let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points2D#class_ids")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -386,7 +386,7 @@ impl ::re_types_core::Archetype for Points2D { }; let keypoint_ids = if let Some(array) = arrays_by_name.get("rerun.components.KeypointId") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points2D#keypoint_ids")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) diff --git a/crates/store/re_types/src/archetypes/points3d.rs b/crates/store/re_types/src/archetypes/points3d.rs index 0828e9e0eda4..8e021288eca1 100644 --- a/crates/store/re_types/src/archetypes/points3d.rs +++ b/crates/store/re_types/src/archetypes/points3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -280,8 +280,8 @@ impl ::re_types_core::Archetype for Points3D { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -294,7 +294,7 @@ impl ::re_types_core::Archetype for Points3D { .get("rerun.components.Position3D") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Points3D#positions")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points3D#positions")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -303,7 +303,7 @@ impl ::re_types_core::Archetype for Points3D { }; let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points3D#radii")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -315,7 +315,7 @@ impl ::re_types_core::Archetype for Points3D { }; let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points3D#colors")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -327,7 +327,7 @@ impl ::re_types_core::Archetype for Points3D { }; let labels = if let Some(array) = arrays_by_name.get("rerun.components.Text") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points3D#labels")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -338,7 +338,7 @@ impl ::re_types_core::Archetype for Points3D { None }; let show_labels = if let Some(array) = arrays_by_name.get("rerun.components.ShowLabels") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points3D#show_labels")? .into_iter() .next() @@ -348,7 +348,7 @@ impl ::re_types_core::Archetype for Points3D { }; let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points3D#class_ids")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -360,7 +360,7 @@ impl ::re_types_core::Archetype for Points3D { }; let keypoint_ids = if let Some(array) = arrays_by_name.get("rerun.components.KeypointId") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points3D#keypoint_ids")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) diff --git a/crates/store/re_types/src/archetypes/scalar.rs b/crates/store/re_types/src/archetypes/scalar.rs index 8bebaac4327a..d2ab11cb569b 100644 --- a/crates/store/re_types/src/archetypes/scalar.rs +++ b/crates/store/re_types/src/archetypes/scalar.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -144,8 +144,8 @@ impl ::re_types_core::Archetype for Scalar { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -158,7 +158,7 @@ impl ::re_types_core::Archetype for Scalar { .get("rerun.components.Scalar") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Scalar#scalar")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Scalar#scalar")? .into_iter() .next() diff --git a/crates/store/re_types/src/archetypes/segmentation_image.rs b/crates/store/re_types/src/archetypes/segmentation_image.rs index b26145d93c44..5666639343a6 100644 --- a/crates/store/re_types/src/archetypes/segmentation_image.rs +++ b/crates/store/re_types/src/archetypes/segmentation_image.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -203,8 +203,8 @@ impl ::re_types_core::Archetype for SegmentationImage { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -217,7 +217,7 @@ impl ::re_types_core::Archetype for SegmentationImage { .get("rerun.components.ImageBuffer") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.SegmentationImage#buffer")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SegmentationImage#buffer")? .into_iter() .next() @@ -230,7 +230,7 @@ impl ::re_types_core::Archetype for SegmentationImage { .get("rerun.components.ImageFormat") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.SegmentationImage#format")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SegmentationImage#format")? .into_iter() .next() @@ -239,7 +239,7 @@ impl ::re_types_core::Archetype for SegmentationImage { .with_context("rerun.archetypes.SegmentationImage#format")? }; let opacity = if let Some(array) = arrays_by_name.get("rerun.components.Opacity") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SegmentationImage#opacity")? .into_iter() .next() @@ -248,7 +248,7 @@ impl ::re_types_core::Archetype for SegmentationImage { None }; let draw_order = if let Some(array) = arrays_by_name.get("rerun.components.DrawOrder") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SegmentationImage#draw_order")? .into_iter() .next() diff --git a/crates/store/re_types/src/archetypes/series_line.rs b/crates/store/re_types/src/archetypes/series_line.rs index 258b7bd9996c..bf42e18c3a48 100644 --- a/crates/store/re_types/src/archetypes/series_line.rs +++ b/crates/store/re_types/src/archetypes/series_line.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -207,8 +207,8 @@ impl ::re_types_core::Archetype for SeriesLine { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -217,7 +217,7 @@ impl ::re_types_core::Archetype for SeriesLine { .map(|(name, array)| (name.full_name(), array)) .collect(); let color = if let Some(array) = arrays_by_name.get("rerun.components.Color") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SeriesLine#color")? .into_iter() .next() @@ -226,7 +226,7 @@ impl ::re_types_core::Archetype for SeriesLine { None }; let width = if let Some(array) = arrays_by_name.get("rerun.components.StrokeWidth") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SeriesLine#width")? .into_iter() .next() @@ -235,7 +235,7 @@ impl ::re_types_core::Archetype for SeriesLine { None }; let name = if let Some(array) = arrays_by_name.get("rerun.components.Name") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SeriesLine#name")? .into_iter() .next() @@ -245,7 +245,7 @@ impl ::re_types_core::Archetype for SeriesLine { }; let aggregation_policy = if let Some(array) = arrays_by_name.get("rerun.components.AggregationPolicy") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SeriesLine#aggregation_policy")? .into_iter() .next() diff --git a/crates/store/re_types/src/archetypes/series_point.rs b/crates/store/re_types/src/archetypes/series_point.rs index b77a9c91b18b..4330a1006dd0 100644 --- a/crates/store/re_types/src/archetypes/series_point.rs +++ b/crates/store/re_types/src/archetypes/series_point.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -205,8 +205,8 @@ impl ::re_types_core::Archetype for SeriesPoint { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -215,7 +215,7 @@ impl ::re_types_core::Archetype for SeriesPoint { .map(|(name, array)| (name.full_name(), array)) .collect(); let color = if let Some(array) = arrays_by_name.get("rerun.components.Color") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SeriesPoint#color")? .into_iter() .next() @@ -224,7 +224,7 @@ impl ::re_types_core::Archetype for SeriesPoint { None }; let marker = if let Some(array) = arrays_by_name.get("rerun.components.MarkerShape") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SeriesPoint#marker")? .into_iter() .next() @@ -233,7 +233,7 @@ impl ::re_types_core::Archetype for SeriesPoint { None }; let name = if let Some(array) = arrays_by_name.get("rerun.components.Name") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SeriesPoint#name")? .into_iter() .next() @@ -242,7 +242,7 @@ impl ::re_types_core::Archetype for SeriesPoint { None }; let marker_size = if let Some(array) = arrays_by_name.get("rerun.components.MarkerSize") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SeriesPoint#marker_size")? .into_iter() .next() diff --git a/crates/store/re_types/src/archetypes/tensor.rs b/crates/store/re_types/src/archetypes/tensor.rs index 54abbdffd86c..30aae6eba302 100644 --- a/crates/store/re_types/src/archetypes/tensor.rs +++ b/crates/store/re_types/src/archetypes/tensor.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -163,8 +163,8 @@ impl ::re_types_core::Archetype for Tensor { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -177,7 +177,7 @@ impl ::re_types_core::Archetype for Tensor { .get("rerun.components.TensorData") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Tensor#data")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Tensor#data")? .into_iter() .next() @@ -186,7 +186,7 @@ impl ::re_types_core::Archetype for Tensor { .with_context("rerun.archetypes.Tensor#data")? }; let value_range = if let Some(array) = arrays_by_name.get("rerun.components.ValueRange") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Tensor#value_range")? .into_iter() .next() diff --git a/crates/store/re_types/src/archetypes/text_document.rs b/crates/store/re_types/src/archetypes/text_document.rs index 06d506570baf..28de2bb51fcf 100644 --- a/crates/store/re_types/src/archetypes/text_document.rs +++ b/crates/store/re_types/src/archetypes/text_document.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -198,8 +198,8 @@ impl ::re_types_core::Archetype for TextDocument { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -212,7 +212,7 @@ impl ::re_types_core::Archetype for TextDocument { .get("rerun.components.Text") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.TextDocument#text")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.TextDocument#text")? .into_iter() .next() @@ -221,7 +221,7 @@ impl ::re_types_core::Archetype for TextDocument { .with_context("rerun.archetypes.TextDocument#text")? }; let media_type = if let Some(array) = arrays_by_name.get("rerun.components.MediaType") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.TextDocument#media_type")? .into_iter() .next() diff --git a/crates/store/re_types/src/archetypes/text_log.rs b/crates/store/re_types/src/archetypes/text_log.rs index c23408094261..3c0c07e6ec18 100644 --- a/crates/store/re_types/src/archetypes/text_log.rs +++ b/crates/store/re_types/src/archetypes/text_log.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -180,8 +180,8 @@ impl ::re_types_core::Archetype for TextLog { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -194,7 +194,7 @@ impl ::re_types_core::Archetype for TextLog { .get("rerun.components.Text") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.TextLog#text")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.TextLog#text")? .into_iter() .next() @@ -203,7 +203,7 @@ impl ::re_types_core::Archetype for TextLog { .with_context("rerun.archetypes.TextLog#text")? }; let level = if let Some(array) = arrays_by_name.get("rerun.components.TextLogLevel") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.TextLog#level")? .into_iter() .next() @@ -212,7 +212,7 @@ impl ::re_types_core::Archetype for TextLog { None }; let color = if let Some(array) = arrays_by_name.get("rerun.components.Color") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.TextLog#color")? .into_iter() .next() diff --git a/crates/store/re_types/src/archetypes/transform3d.rs b/crates/store/re_types/src/archetypes/transform3d.rs index 81eeef4990e0..813acd9152dc 100644 --- a/crates/store/re_types/src/archetypes/transform3d.rs +++ b/crates/store/re_types/src/archetypes/transform3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -340,8 +340,8 @@ impl ::re_types_core::Archetype for Transform3D { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -351,7 +351,7 @@ impl ::re_types_core::Archetype for Transform3D { .collect(); let translation = if let Some(array) = arrays_by_name.get("rerun.components.Translation3D") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Transform3D#translation")? .into_iter() .next() @@ -361,7 +361,7 @@ impl ::re_types_core::Archetype for Transform3D { }; let rotation_axis_angle = if let Some(array) = arrays_by_name.get("rerun.components.RotationAxisAngle") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Transform3D#rotation_axis_angle")? .into_iter() .next() @@ -370,7 +370,7 @@ impl ::re_types_core::Archetype for Transform3D { None }; let quaternion = if let Some(array) = arrays_by_name.get("rerun.components.RotationQuat") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Transform3D#quaternion")? .into_iter() .next() @@ -379,7 +379,7 @@ impl ::re_types_core::Archetype for Transform3D { None }; let scale = if let Some(array) = arrays_by_name.get("rerun.components.Scale3D") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Transform3D#scale")? .into_iter() .next() @@ -388,7 +388,7 @@ impl ::re_types_core::Archetype for Transform3D { None }; let mat3x3 = if let Some(array) = arrays_by_name.get("rerun.components.TransformMat3x3") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Transform3D#mat3x3")? .into_iter() .next() @@ -398,7 +398,7 @@ impl ::re_types_core::Archetype for Transform3D { }; let relation = if let Some(array) = arrays_by_name.get("rerun.components.TransformRelation") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Transform3D#relation")? .into_iter() .next() @@ -407,7 +407,7 @@ impl ::re_types_core::Archetype for Transform3D { None }; let axis_length = if let Some(array) = arrays_by_name.get("rerun.components.AxisLength") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Transform3D#axis_length")? .into_iter() .next() diff --git a/crates/store/re_types/src/archetypes/video_frame_reference.rs b/crates/store/re_types/src/archetypes/video_frame_reference.rs index e302867c0531..fbb0a08a51e7 100644 --- a/crates/store/re_types/src/archetypes/video_frame_reference.rs +++ b/crates/store/re_types/src/archetypes/video_frame_reference.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -243,8 +243,8 @@ impl ::re_types_core::Archetype for VideoFrameReference { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -257,7 +257,7 @@ impl ::re_types_core::Archetype for VideoFrameReference { .get("rerun.components.VideoTimestamp") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.VideoFrameReference#timestamp")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.VideoFrameReference#timestamp")? .into_iter() .next() @@ -267,7 +267,7 @@ impl ::re_types_core::Archetype for VideoFrameReference { }; let video_reference = if let Some(array) = arrays_by_name.get("rerun.components.EntityPath") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.VideoFrameReference#video_reference")? .into_iter() .next() diff --git a/crates/store/re_types/src/archetypes/view_coordinates.rs b/crates/store/re_types/src/archetypes/view_coordinates.rs index 4007da4f52f6..d022dbee1b7d 100644 --- a/crates/store/re_types/src/archetypes/view_coordinates.rs +++ b/crates/store/re_types/src/archetypes/view_coordinates.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -151,8 +151,8 @@ impl ::re_types_core::Archetype for ViewCoordinates { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -165,7 +165,7 @@ impl ::re_types_core::Archetype for ViewCoordinates { .get("rerun.components.ViewCoordinates") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.ViewCoordinates#xyz")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.ViewCoordinates#xyz")? .into_iter() .next() diff --git a/crates/store/re_types/src/blueprint/archetypes/background.rs b/crates/store/re_types/src/blueprint/archetypes/background.rs index 0b56c276a7e5..f618a6c1775b 100644 --- a/crates/store/re_types/src/blueprint/archetypes/background.rs +++ b/crates/store/re_types/src/blueprint/archetypes/background.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -124,8 +124,8 @@ impl ::re_types_core::Archetype for Background { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -138,7 +138,7 @@ impl ::re_types_core::Archetype for Background { .get("rerun.blueprint.components.BackgroundKind") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.blueprint.archetypes.Background#kind")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.Background#kind")? .into_iter() .next() @@ -147,7 +147,7 @@ impl ::re_types_core::Archetype for Background { .with_context("rerun.blueprint.archetypes.Background#kind")? }; let color = if let Some(array) = arrays_by_name.get("rerun.components.Color") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.Background#color")? .into_iter() .next() diff --git a/crates/store/re_types/src/blueprint/archetypes/container_blueprint.rs b/crates/store/re_types/src/blueprint/archetypes/container_blueprint.rs index 2971a46e1150..6c7f40d67170 100644 --- a/crates/store/re_types/src/blueprint/archetypes/container_blueprint.rs +++ b/crates/store/re_types/src/blueprint/archetypes/container_blueprint.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -221,8 +221,8 @@ impl ::re_types_core::Archetype for ContainerBlueprint { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -235,7 +235,7 @@ impl ::re_types_core::Archetype for ContainerBlueprint { .get("rerun.blueprint.components.ContainerKind") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.blueprint.archetypes.ContainerBlueprint#container_kind")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ContainerBlueprint#container_kind")? .into_iter() .next() @@ -244,7 +244,7 @@ impl ::re_types_core::Archetype for ContainerBlueprint { .with_context("rerun.blueprint.archetypes.ContainerBlueprint#container_kind")? }; let display_name = if let Some(array) = arrays_by_name.get("rerun.components.Name") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ContainerBlueprint#display_name")? .into_iter() .next() @@ -255,7 +255,7 @@ impl ::re_types_core::Archetype for ContainerBlueprint { let contents = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.IncludedContent") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ContainerBlueprint#contents")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -268,7 +268,7 @@ impl ::re_types_core::Archetype for ContainerBlueprint { let col_shares = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ColumnShare") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ContainerBlueprint#col_shares")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -281,7 +281,7 @@ impl ::re_types_core::Archetype for ContainerBlueprint { let row_shares = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.RowShare") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ContainerBlueprint#row_shares")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -293,7 +293,7 @@ impl ::re_types_core::Archetype for ContainerBlueprint { }; let active_tab = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ActiveTab") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ContainerBlueprint#active_tab")? .into_iter() .next() @@ -303,7 +303,7 @@ impl ::re_types_core::Archetype for ContainerBlueprint { }; let visible = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.Visible") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ContainerBlueprint#visible")? .into_iter() .next() @@ -313,7 +313,7 @@ impl ::re_types_core::Archetype for ContainerBlueprint { }; let grid_columns = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.GridColumns") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ContainerBlueprint#grid_columns")? .into_iter() .next() diff --git a/crates/store/re_types/src/blueprint/archetypes/dataframe_query.rs b/crates/store/re_types/src/blueprint/archetypes/dataframe_query.rs index 22044c2a31ed..afaf46247507 100644 --- a/crates/store/re_types/src/blueprint/archetypes/dataframe_query.rs +++ b/crates/store/re_types/src/blueprint/archetypes/dataframe_query.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -168,8 +168,8 @@ impl ::re_types_core::Archetype for DataframeQuery { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -179,7 +179,7 @@ impl ::re_types_core::Archetype for DataframeQuery { .collect(); let timeline = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.TimelineName") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.DataframeQuery#timeline")? .into_iter() .next() @@ -189,7 +189,7 @@ impl ::re_types_core::Archetype for DataframeQuery { }; let filter_by_range = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.FilterByRange") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.DataframeQuery#filter_by_range")? .into_iter() .next() @@ -199,7 +199,7 @@ impl ::re_types_core::Archetype for DataframeQuery { }; let filter_is_not_null = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.FilterIsNotNull") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.DataframeQuery#filter_is_not_null")? .into_iter() .next() @@ -209,7 +209,7 @@ impl ::re_types_core::Archetype for DataframeQuery { }; let apply_latest_at = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ApplyLatestAt") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.DataframeQuery#apply_latest_at")? .into_iter() .next() @@ -219,7 +219,7 @@ impl ::re_types_core::Archetype for DataframeQuery { }; let select = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.SelectedColumns") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.DataframeQuery#select")? .into_iter() .next() diff --git a/crates/store/re_types/src/blueprint/archetypes/force_center.rs b/crates/store/re_types/src/blueprint/archetypes/force_center.rs index 5f12962b42dc..f8d530b4f5dd 100644 --- a/crates/store/re_types/src/blueprint/archetypes/force_center.rs +++ b/crates/store/re_types/src/blueprint/archetypes/force_center.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -127,8 +127,8 @@ impl ::re_types_core::Archetype for ForceCenter { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -138,7 +138,7 @@ impl ::re_types_core::Archetype for ForceCenter { .collect(); let enabled = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.Enabled") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ForceCenter#enabled")? .into_iter() .next() @@ -148,7 +148,7 @@ impl ::re_types_core::Archetype for ForceCenter { }; let strength = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ForceStrength") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ForceCenter#strength")? .into_iter() .next() diff --git a/crates/store/re_types/src/blueprint/archetypes/force_collision_radius.rs b/crates/store/re_types/src/blueprint/archetypes/force_collision_radius.rs index 9f4536a2b750..e7c2cccede20 100644 --- a/crates/store/re_types/src/blueprint/archetypes/force_collision_radius.rs +++ b/crates/store/re_types/src/blueprint/archetypes/force_collision_radius.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -143,8 +143,8 @@ impl ::re_types_core::Archetype for ForceCollisionRadius { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -154,7 +154,7 @@ impl ::re_types_core::Archetype for ForceCollisionRadius { .collect(); let enabled = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.Enabled") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ForceCollisionRadius#enabled")? .into_iter() .next() @@ -164,7 +164,7 @@ impl ::re_types_core::Archetype for ForceCollisionRadius { }; let strength = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ForceStrength") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ForceCollisionRadius#strength")? .into_iter() .next() @@ -174,7 +174,7 @@ impl ::re_types_core::Archetype for ForceCollisionRadius { }; let iterations = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ForceIterations") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ForceCollisionRadius#iterations")? .into_iter() .next() diff --git a/crates/store/re_types/src/blueprint/archetypes/force_link.rs b/crates/store/re_types/src/blueprint/archetypes/force_link.rs index f294b0eb9818..f10220eda196 100644 --- a/crates/store/re_types/src/blueprint/archetypes/force_link.rs +++ b/crates/store/re_types/src/blueprint/archetypes/force_link.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -142,8 +142,8 @@ impl ::re_types_core::Archetype for ForceLink { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -153,7 +153,7 @@ impl ::re_types_core::Archetype for ForceLink { .collect(); let enabled = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.Enabled") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ForceLink#enabled")? .into_iter() .next() @@ -163,7 +163,7 @@ impl ::re_types_core::Archetype for ForceLink { }; let distance = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ForceDistance") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ForceLink#distance")? .into_iter() .next() @@ -173,7 +173,7 @@ impl ::re_types_core::Archetype for ForceLink { }; let iterations = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ForceIterations") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ForceLink#iterations")? .into_iter() .next() diff --git a/crates/store/re_types/src/blueprint/archetypes/force_many_body.rs b/crates/store/re_types/src/blueprint/archetypes/force_many_body.rs index 026e249436d4..ebc69af80fbf 100644 --- a/crates/store/re_types/src/blueprint/archetypes/force_many_body.rs +++ b/crates/store/re_types/src/blueprint/archetypes/force_many_body.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -132,8 +132,8 @@ impl ::re_types_core::Archetype for ForceManyBody { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -143,7 +143,7 @@ impl ::re_types_core::Archetype for ForceManyBody { .collect(); let enabled = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.Enabled") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ForceManyBody#enabled")? .into_iter() .next() @@ -153,7 +153,7 @@ impl ::re_types_core::Archetype for ForceManyBody { }; let strength = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ForceStrength") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ForceManyBody#strength")? .into_iter() .next() diff --git a/crates/store/re_types/src/blueprint/archetypes/force_position.rs b/crates/store/re_types/src/blueprint/archetypes/force_position.rs index cc74aa2aabf4..ccf3a6fa9941 100644 --- a/crates/store/re_types/src/blueprint/archetypes/force_position.rs +++ b/crates/store/re_types/src/blueprint/archetypes/force_position.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -140,8 +140,8 @@ impl ::re_types_core::Archetype for ForcePosition { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -151,7 +151,7 @@ impl ::re_types_core::Archetype for ForcePosition { .collect(); let enabled = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.Enabled") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ForcePosition#enabled")? .into_iter() .next() @@ -161,7 +161,7 @@ impl ::re_types_core::Archetype for ForcePosition { }; let strength = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ForceStrength") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ForcePosition#strength")? .into_iter() .next() @@ -170,7 +170,7 @@ impl ::re_types_core::Archetype for ForcePosition { None }; let position = if let Some(array) = arrays_by_name.get("rerun.components.Position2D") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ForcePosition#position")? .into_iter() .next() diff --git a/crates/store/re_types/src/blueprint/archetypes/line_grid3d.rs b/crates/store/re_types/src/blueprint/archetypes/line_grid3d.rs index 3442f7edc628..d9653c29b657 100644 --- a/crates/store/re_types/src/blueprint/archetypes/line_grid3d.rs +++ b/crates/store/re_types/src/blueprint/archetypes/line_grid3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -176,8 +176,8 @@ impl ::re_types_core::Archetype for LineGrid3D { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -187,7 +187,7 @@ impl ::re_types_core::Archetype for LineGrid3D { .collect(); let visible = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.Visible") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.LineGrid3D#visible")? .into_iter() .next() @@ -197,7 +197,7 @@ impl ::re_types_core::Archetype for LineGrid3D { }; let spacing = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.GridSpacing") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.LineGrid3D#spacing")? .into_iter() .next() @@ -206,7 +206,7 @@ impl ::re_types_core::Archetype for LineGrid3D { None }; let plane = if let Some(array) = arrays_by_name.get("rerun.components.Plane3D") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.LineGrid3D#plane")? .into_iter() .next() @@ -215,7 +215,7 @@ impl ::re_types_core::Archetype for LineGrid3D { None }; let stroke_width = if let Some(array) = arrays_by_name.get("rerun.components.StrokeWidth") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.LineGrid3D#stroke_width")? .into_iter() .next() @@ -224,7 +224,7 @@ impl ::re_types_core::Archetype for LineGrid3D { None }; let color = if let Some(array) = arrays_by_name.get("rerun.components.Color") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.LineGrid3D#color")? .into_iter() .next() diff --git a/crates/store/re_types/src/blueprint/archetypes/map_background.rs b/crates/store/re_types/src/blueprint/archetypes/map_background.rs index 7efeb6d2a687..0d988319a55a 100644 --- a/crates/store/re_types/src/blueprint/archetypes/map_background.rs +++ b/crates/store/re_types/src/blueprint/archetypes/map_background.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -112,8 +112,8 @@ impl ::re_types_core::Archetype for MapBackground { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -126,7 +126,7 @@ impl ::re_types_core::Archetype for MapBackground { .get("rerun.blueprint.components.MapProvider") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.blueprint.archetypes.MapBackground#provider")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.MapBackground#provider")? .into_iter() .next() diff --git a/crates/store/re_types/src/blueprint/archetypes/map_zoom.rs b/crates/store/re_types/src/blueprint/archetypes/map_zoom.rs index d4f68720d285..3da825443290 100644 --- a/crates/store/re_types/src/blueprint/archetypes/map_zoom.rs +++ b/crates/store/re_types/src/blueprint/archetypes/map_zoom.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -112,8 +112,8 @@ impl ::re_types_core::Archetype for MapZoom { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -126,7 +126,7 @@ impl ::re_types_core::Archetype for MapZoom { .get("rerun.blueprint.components.ZoomLevel") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.blueprint.archetypes.MapZoom#zoom")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.MapZoom#zoom")? .into_iter() .next() diff --git a/crates/store/re_types/src/blueprint/archetypes/near_clip_plane.rs b/crates/store/re_types/src/blueprint/archetypes/near_clip_plane.rs index 9714d55ddff1..4fc8acbe3136 100644 --- a/crates/store/re_types/src/blueprint/archetypes/near_clip_plane.rs +++ b/crates/store/re_types/src/blueprint/archetypes/near_clip_plane.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -112,8 +112,8 @@ impl ::re_types_core::Archetype for NearClipPlane { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -126,7 +126,7 @@ impl ::re_types_core::Archetype for NearClipPlane { .get("rerun.blueprint.components.NearClipPlane") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.blueprint.archetypes.NearClipPlane#near_clip_plane")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.NearClipPlane#near_clip_plane")? .into_iter() .next() diff --git a/crates/store/re_types/src/blueprint/archetypes/panel_blueprint.rs b/crates/store/re_types/src/blueprint/archetypes/panel_blueprint.rs index 7f55137e124f..84b58f482b9b 100644 --- a/crates/store/re_types/src/blueprint/archetypes/panel_blueprint.rs +++ b/crates/store/re_types/src/blueprint/archetypes/panel_blueprint.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -110,8 +110,8 @@ impl ::re_types_core::Archetype for PanelBlueprint { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -121,7 +121,7 @@ impl ::re_types_core::Archetype for PanelBlueprint { .collect(); let state = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.PanelState") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.PanelBlueprint#state")? .into_iter() .next() diff --git a/crates/store/re_types/src/blueprint/archetypes/plot_legend.rs b/crates/store/re_types/src/blueprint/archetypes/plot_legend.rs index 7c371c5c9a44..62ecd63f035c 100644 --- a/crates/store/re_types/src/blueprint/archetypes/plot_legend.rs +++ b/crates/store/re_types/src/blueprint/archetypes/plot_legend.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -129,8 +129,8 @@ impl ::re_types_core::Archetype for PlotLegend { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -140,7 +140,7 @@ impl ::re_types_core::Archetype for PlotLegend { .collect(); let corner = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.Corner2D") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.PlotLegend#corner")? .into_iter() .next() @@ -150,7 +150,7 @@ impl ::re_types_core::Archetype for PlotLegend { }; let visible = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.Visible") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.PlotLegend#visible")? .into_iter() .next() diff --git a/crates/store/re_types/src/blueprint/archetypes/scalar_axis.rs b/crates/store/re_types/src/blueprint/archetypes/scalar_axis.rs index a6a75ebc6def..806b4d56b485 100644 --- a/crates/store/re_types/src/blueprint/archetypes/scalar_axis.rs +++ b/crates/store/re_types/src/blueprint/archetypes/scalar_axis.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -127,8 +127,8 @@ impl ::re_types_core::Archetype for ScalarAxis { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -137,7 +137,7 @@ impl ::re_types_core::Archetype for ScalarAxis { .map(|(name, array)| (name.full_name(), array)) .collect(); let range = if let Some(array) = arrays_by_name.get("rerun.components.Range1D") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ScalarAxis#range")? .into_iter() .next() @@ -148,7 +148,7 @@ impl ::re_types_core::Archetype for ScalarAxis { let zoom_lock = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.LockRangeDuringZoom") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ScalarAxis#zoom_lock")? .into_iter() .next() diff --git a/crates/store/re_types/src/blueprint/archetypes/tensor_scalar_mapping.rs b/crates/store/re_types/src/blueprint/archetypes/tensor_scalar_mapping.rs index 0756e3347a66..2de47b2a4d46 100644 --- a/crates/store/re_types/src/blueprint/archetypes/tensor_scalar_mapping.rs +++ b/crates/store/re_types/src/blueprint/archetypes/tensor_scalar_mapping.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -147,8 +147,8 @@ impl ::re_types_core::Archetype for TensorScalarMapping { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -158,7 +158,7 @@ impl ::re_types_core::Archetype for TensorScalarMapping { .collect(); let mag_filter = if let Some(array) = arrays_by_name.get("rerun.components.MagnificationFilter") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.TensorScalarMapping#mag_filter")? .into_iter() .next() @@ -167,7 +167,7 @@ impl ::re_types_core::Archetype for TensorScalarMapping { None }; let colormap = if let Some(array) = arrays_by_name.get("rerun.components.Colormap") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.TensorScalarMapping#colormap")? .into_iter() .next() @@ -176,7 +176,7 @@ impl ::re_types_core::Archetype for TensorScalarMapping { None }; let gamma = if let Some(array) = arrays_by_name.get("rerun.components.GammaCorrection") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.TensorScalarMapping#gamma")? .into_iter() .next() diff --git a/crates/store/re_types/src/blueprint/archetypes/tensor_slice_selection.rs b/crates/store/re_types/src/blueprint/archetypes/tensor_slice_selection.rs index 422cd47a38d7..b49025d97c0d 100644 --- a/crates/store/re_types/src/blueprint/archetypes/tensor_slice_selection.rs +++ b/crates/store/re_types/src/blueprint/archetypes/tensor_slice_selection.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -162,8 +162,8 @@ impl ::re_types_core::Archetype for TensorSliceSelection { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -173,7 +173,7 @@ impl ::re_types_core::Archetype for TensorSliceSelection { .collect(); let width = if let Some(array) = arrays_by_name.get("rerun.components.TensorWidthDimension") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.TensorSliceSelection#width")? .into_iter() .next() @@ -183,7 +183,7 @@ impl ::re_types_core::Archetype for TensorSliceSelection { }; let height = if let Some(array) = arrays_by_name.get("rerun.components.TensorHeightDimension") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.TensorSliceSelection#height")? .into_iter() .next() @@ -195,7 +195,7 @@ impl ::re_types_core::Archetype for TensorSliceSelection { arrays_by_name.get("rerun.components.TensorDimensionIndexSelection") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.TensorSliceSelection#indices")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -209,14 +209,12 @@ impl ::re_types_core::Archetype for TensorSliceSelection { arrays_by_name.get("rerun.blueprint.components.TensorDimensionIndexSlider") { Some({ - ::from_arrow2_opt( - &**array, - ) - .with_context("rerun.blueprint.archetypes.TensorSliceSelection#slider")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.blueprint.archetypes.TensorSliceSelection#slider")? + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.TensorSliceSelection#slider")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.blueprint.archetypes.TensorSliceSelection#slider")? }) } else { None diff --git a/crates/store/re_types/src/blueprint/archetypes/tensor_view_fit.rs b/crates/store/re_types/src/blueprint/archetypes/tensor_view_fit.rs index 8e6bbfd0aa10..e4f17be0efab 100644 --- a/crates/store/re_types/src/blueprint/archetypes/tensor_view_fit.rs +++ b/crates/store/re_types/src/blueprint/archetypes/tensor_view_fit.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -110,8 +110,8 @@ impl ::re_types_core::Archetype for TensorViewFit { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -121,7 +121,7 @@ impl ::re_types_core::Archetype for TensorViewFit { .collect(); let scaling = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ViewFit") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.TensorViewFit#scaling")? .into_iter() .next() diff --git a/crates/store/re_types/src/blueprint/archetypes/view_blueprint.rs b/crates/store/re_types/src/blueprint/archetypes/view_blueprint.rs index 2cc4714acc07..539c27e09131 100644 --- a/crates/store/re_types/src/blueprint/archetypes/view_blueprint.rs +++ b/crates/store/re_types/src/blueprint/archetypes/view_blueprint.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -160,8 +160,8 @@ impl ::re_types_core::Archetype for ViewBlueprint { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -174,7 +174,7 @@ impl ::re_types_core::Archetype for ViewBlueprint { .get("rerun.blueprint.components.ViewClass") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.blueprint.archetypes.ViewBlueprint#class_identifier")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ViewBlueprint#class_identifier")? .into_iter() .next() @@ -183,7 +183,7 @@ impl ::re_types_core::Archetype for ViewBlueprint { .with_context("rerun.blueprint.archetypes.ViewBlueprint#class_identifier")? }; let display_name = if let Some(array) = arrays_by_name.get("rerun.components.Name") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ViewBlueprint#display_name")? .into_iter() .next() @@ -193,7 +193,7 @@ impl ::re_types_core::Archetype for ViewBlueprint { }; let space_origin = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ViewOrigin") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ViewBlueprint#space_origin")? .into_iter() .next() @@ -203,7 +203,7 @@ impl ::re_types_core::Archetype for ViewBlueprint { }; let visible = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.Visible") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ViewBlueprint#visible")? .into_iter() .next() diff --git a/crates/store/re_types/src/blueprint/archetypes/view_contents.rs b/crates/store/re_types/src/blueprint/archetypes/view_contents.rs index a748140632bd..851f7917243d 100644 --- a/crates/store/re_types/src/blueprint/archetypes/view_contents.rs +++ b/crates/store/re_types/src/blueprint/archetypes/view_contents.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -149,8 +149,8 @@ impl ::re_types_core::Archetype for ViewContents { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -163,7 +163,7 @@ impl ::re_types_core::Archetype for ViewContents { .get("rerun.blueprint.components.QueryExpression") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.blueprint.archetypes.ViewContents#query")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ViewContents#query")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) diff --git a/crates/store/re_types/src/blueprint/archetypes/viewport_blueprint.rs b/crates/store/re_types/src/blueprint/archetypes/viewport_blueprint.rs index 5c75fa92e887..826c78b47730 100644 --- a/crates/store/re_types/src/blueprint/archetypes/viewport_blueprint.rs +++ b/crates/store/re_types/src/blueprint/archetypes/viewport_blueprint.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -177,8 +177,8 @@ impl ::re_types_core::Archetype for ViewportBlueprint { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -188,7 +188,7 @@ impl ::re_types_core::Archetype for ViewportBlueprint { .collect(); let root_container = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.RootContainer") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ViewportBlueprint#root_container")? .into_iter() .next() @@ -198,7 +198,7 @@ impl ::re_types_core::Archetype for ViewportBlueprint { }; let maximized = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ViewMaximized") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ViewportBlueprint#maximized")? .into_iter() .next() @@ -208,7 +208,7 @@ impl ::re_types_core::Archetype for ViewportBlueprint { }; let auto_layout = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.AutoLayout") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ViewportBlueprint#auto_layout")? .into_iter() .next() @@ -218,7 +218,7 @@ impl ::re_types_core::Archetype for ViewportBlueprint { }; let auto_views = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.AutoViews") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ViewportBlueprint#auto_views")? .into_iter() .next() @@ -230,7 +230,7 @@ impl ::re_types_core::Archetype for ViewportBlueprint { arrays_by_name.get("rerun.blueprint.components.ViewerRecommendationHash") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context( "rerun.blueprint.archetypes.ViewportBlueprint#past_viewer_recommendations", )? diff --git a/crates/store/re_types/src/blueprint/archetypes/visible_time_ranges.rs b/crates/store/re_types/src/blueprint/archetypes/visible_time_ranges.rs index 8056a916b681..eb47853697b8 100644 --- a/crates/store/re_types/src/blueprint/archetypes/visible_time_ranges.rs +++ b/crates/store/re_types/src/blueprint/archetypes/visible_time_ranges.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -120,8 +120,8 @@ impl ::re_types_core::Archetype for VisibleTimeRanges { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -134,7 +134,7 @@ impl ::re_types_core::Archetype for VisibleTimeRanges { .get("rerun.blueprint.components.VisibleTimeRange") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.blueprint.archetypes.VisibleTimeRanges#ranges")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.VisibleTimeRanges#ranges")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) diff --git a/crates/store/re_types/src/blueprint/archetypes/visual_bounds2d.rs b/crates/store/re_types/src/blueprint/archetypes/visual_bounds2d.rs index e409e5dbd94a..dfc0918ccaee 100644 --- a/crates/store/re_types/src/blueprint/archetypes/visual_bounds2d.rs +++ b/crates/store/re_types/src/blueprint/archetypes/visual_bounds2d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -118,8 +118,8 @@ impl ::re_types_core::Archetype for VisualBounds2D { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -132,7 +132,7 @@ impl ::re_types_core::Archetype for VisualBounds2D { .get("rerun.blueprint.components.VisualBounds2D") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.blueprint.archetypes.VisualBounds2D#range")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.VisualBounds2D#range")? .into_iter() .next() diff --git a/crates/store/re_types/src/blueprint/components/active_tab.rs b/crates/store/re_types/src/blueprint/components/active_tab.rs index 36b7359658fc..1705b356fabd 100644 --- a/crates/store/re_types/src/blueprint/components/active_tab.rs +++ b/crates/store/re_types/src/blueprint/components/active_tab.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -56,13 +56,13 @@ impl ::re_types_core::Loggable for ActiveTab { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::EntityPath::from_arrow2_opt(arrow_data) + crate::datatypes::EntityPath::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/apply_latest_at.rs b/crates/store/re_types/src/blueprint/components/apply_latest_at.rs index faf8dc094e44..906b555d92e9 100644 --- a/crates/store/re_types/src/blueprint/components/apply_latest_at.rs +++ b/crates/store/re_types/src/blueprint/components/apply_latest_at.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,13 +52,13 @@ impl ::re_types_core::Loggable for ApplyLatestAt { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Bool::from_arrow2_opt(arrow_data) + crate::datatypes::Bool::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/auto_layout.rs b/crates/store/re_types/src/blueprint/components/auto_layout.rs index d4087718ebd8..e9446d5edc98 100644 --- a/crates/store/re_types/src/blueprint/components/auto_layout.rs +++ b/crates/store/re_types/src/blueprint/components/auto_layout.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,13 +52,13 @@ impl ::re_types_core::Loggable for AutoLayout { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Bool::from_arrow2_opt(arrow_data) + crate::datatypes::Bool::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/auto_views.rs b/crates/store/re_types/src/blueprint/components/auto_views.rs index a25155016fc0..1021d82c97de 100644 --- a/crates/store/re_types/src/blueprint/components/auto_views.rs +++ b/crates/store/re_types/src/blueprint/components/auto_views.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,13 +52,13 @@ impl ::re_types_core::Loggable for AutoViews { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Bool::from_arrow2_opt(arrow_data) + crate::datatypes::Bool::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/background_kind.rs b/crates/store/re_types/src/blueprint/components/background_kind.rs index 64bad27240f1..e844bcaf15d9 100644 --- a/crates/store/re_types/src/blueprint/components/background_kind.rs +++ b/crates/store/re_types/src/blueprint/components/background_kind.rs @@ -13,7 +13,7 @@ #![allow(clippy::too_many_lines)] #![allow(non_camel_case_types)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -90,16 +90,15 @@ impl ::re_types_core::Loggable for BackgroundKind { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -110,7 +109,6 @@ impl ::re_types_core::Loggable for BackgroundKind { }) .with_context("rerun.blueprint.components.BackgroundKind#enum")? .into_iter() - .map(|opt| opt.copied()) .map(|typ| match typ { Some(1) => Ok(Some(Self::GradientDark)), Some(2) => Ok(Some(Self::GradientBright)), diff --git a/crates/store/re_types/src/blueprint/components/column_share.rs b/crates/store/re_types/src/blueprint/components/column_share.rs index 635ede9eaadd..a86aef376aa2 100644 --- a/crates/store/re_types/src/blueprint/components/column_share.rs +++ b/crates/store/re_types/src/blueprint/components/column_share.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -54,23 +54,22 @@ impl ::re_types_core::Loggable for ColumnShare { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Float32::from_arrow2_opt(arrow_data) + crate::datatypes::Float32::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Float32::from_arrow2(arrow_data) - .map(|v| v.into_iter().map(Self).collect()) + crate::datatypes::Float32::from_arrow(arrow_data).map(|v| v.into_iter().map(Self).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/component_column_selector.rs b/crates/store/re_types/src/blueprint/components/component_column_selector.rs index f76bd4be51a5..2134d2a9956b 100644 --- a/crates/store/re_types/src/blueprint/components/component_column_selector.rs +++ b/crates/store/re_types/src/blueprint/components/component_column_selector.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -54,13 +54,13 @@ impl ::re_types_core::Loggable for ComponentColumnSelector { )) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::blueprint::datatypes::ComponentColumnSelector::from_arrow2_opt(arrow_data) + crate::blueprint::datatypes::ComponentColumnSelector::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/container_kind.rs b/crates/store/re_types/src/blueprint/components/container_kind.rs index 4c3c81c027ae..6b52735b0979 100644 --- a/crates/store/re_types/src/blueprint/components/container_kind.rs +++ b/crates/store/re_types/src/blueprint/components/container_kind.rs @@ -13,7 +13,7 @@ #![allow(clippy::too_many_lines)] #![allow(non_camel_case_types)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -89,16 +89,15 @@ impl ::re_types_core::Loggable for ContainerKind { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -109,7 +108,6 @@ impl ::re_types_core::Loggable for ContainerKind { }) .with_context("rerun.blueprint.components.ContainerKind#enum")? .into_iter() - .map(|opt| opt.copied()) .map(|typ| match typ { Some(1) => Ok(Some(Self::Tabs)), Some(2) => Ok(Some(Self::Horizontal)), diff --git a/crates/store/re_types/src/blueprint/components/corner2d.rs b/crates/store/re_types/src/blueprint/components/corner2d.rs index 2df6b4e36c59..605f0c548ef5 100644 --- a/crates/store/re_types/src/blueprint/components/corner2d.rs +++ b/crates/store/re_types/src/blueprint/components/corner2d.rs @@ -13,7 +13,7 @@ #![allow(clippy::too_many_lines)] #![allow(non_camel_case_types)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -89,16 +89,15 @@ impl ::re_types_core::Loggable for Corner2D { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -109,7 +108,6 @@ impl ::re_types_core::Loggable for Corner2D { }) .with_context("rerun.blueprint.components.Corner2D#enum")? .into_iter() - .map(|opt| opt.copied()) .map(|typ| match typ { Some(1) => Ok(Some(Self::LeftTop)), Some(2) => Ok(Some(Self::RightTop)), diff --git a/crates/store/re_types/src/blueprint/components/enabled.rs b/crates/store/re_types/src/blueprint/components/enabled.rs index dc258abb03d2..2c60c877ec7a 100644 --- a/crates/store/re_types/src/blueprint/components/enabled.rs +++ b/crates/store/re_types/src/blueprint/components/enabled.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,13 +52,13 @@ impl ::re_types_core::Loggable for Enabled { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Bool::from_arrow2_opt(arrow_data) + crate::datatypes::Bool::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/filter_by_range.rs b/crates/store/re_types/src/blueprint/components/filter_by_range.rs index 5b629bb95e69..c83eca4478f9 100644 --- a/crates/store/re_types/src/blueprint/components/filter_by_range.rs +++ b/crates/store/re_types/src/blueprint/components/filter_by_range.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,13 +52,13 @@ impl ::re_types_core::Loggable for FilterByRange { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::blueprint::datatypes::FilterByRange::from_arrow2_opt(arrow_data) + crate::blueprint::datatypes::FilterByRange::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/filter_is_not_null.rs b/crates/store/re_types/src/blueprint/components/filter_is_not_null.rs index 5be06c34de17..c83f8e36db35 100644 --- a/crates/store/re_types/src/blueprint/components/filter_is_not_null.rs +++ b/crates/store/re_types/src/blueprint/components/filter_is_not_null.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,13 +52,13 @@ impl ::re_types_core::Loggable for FilterIsNotNull { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::blueprint::datatypes::FilterIsNotNull::from_arrow2_opt(arrow_data) + crate::blueprint::datatypes::FilterIsNotNull::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/force_distance.rs b/crates/store/re_types/src/blueprint/components/force_distance.rs index 8a70ffc068f7..cd89e49d629a 100644 --- a/crates/store/re_types/src/blueprint/components/force_distance.rs +++ b/crates/store/re_types/src/blueprint/components/force_distance.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -54,23 +54,22 @@ impl ::re_types_core::Loggable for ForceDistance { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Float64::from_arrow2_opt(arrow_data) + crate::datatypes::Float64::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Float64::from_arrow2(arrow_data) - .map(|v| v.into_iter().map(Self).collect()) + crate::datatypes::Float64::from_arrow(arrow_data).map(|v| v.into_iter().map(Self).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/force_iterations.rs b/crates/store/re_types/src/blueprint/components/force_iterations.rs index d91a043a615f..363a03072b59 100644 --- a/crates/store/re_types/src/blueprint/components/force_iterations.rs +++ b/crates/store/re_types/src/blueprint/components/force_iterations.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -54,22 +54,22 @@ impl ::re_types_core::Loggable for ForceIterations { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::UInt64::from_arrow2_opt(arrow_data) + crate::datatypes::UInt64::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::UInt64::from_arrow2(arrow_data).map(|v| v.into_iter().map(Self).collect()) + crate::datatypes::UInt64::from_arrow(arrow_data).map(|v| v.into_iter().map(Self).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/force_strength.rs b/crates/store/re_types/src/blueprint/components/force_strength.rs index d1efe60bbb4f..97c79a10c465 100644 --- a/crates/store/re_types/src/blueprint/components/force_strength.rs +++ b/crates/store/re_types/src/blueprint/components/force_strength.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -54,23 +54,22 @@ impl ::re_types_core::Loggable for ForceStrength { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Float64::from_arrow2_opt(arrow_data) + crate::datatypes::Float64::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Float64::from_arrow2(arrow_data) - .map(|v| v.into_iter().map(Self).collect()) + crate::datatypes::Float64::from_arrow(arrow_data).map(|v| v.into_iter().map(Self).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/grid_columns.rs b/crates/store/re_types/src/blueprint/components/grid_columns.rs index 6ed979d90197..3a98909b37cf 100644 --- a/crates/store/re_types/src/blueprint/components/grid_columns.rs +++ b/crates/store/re_types/src/blueprint/components/grid_columns.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -54,22 +54,22 @@ impl ::re_types_core::Loggable for GridColumns { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::UInt32::from_arrow2_opt(arrow_data) + crate::datatypes::UInt32::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::UInt32::from_arrow2(arrow_data).map(|v| v.into_iter().map(Self).collect()) + crate::datatypes::UInt32::from_arrow(arrow_data).map(|v| v.into_iter().map(Self).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/grid_spacing.rs b/crates/store/re_types/src/blueprint/components/grid_spacing.rs index 4015a22ff884..b9667fbdad76 100644 --- a/crates/store/re_types/src/blueprint/components/grid_spacing.rs +++ b/crates/store/re_types/src/blueprint/components/grid_spacing.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -54,23 +54,22 @@ impl ::re_types_core::Loggable for GridSpacing { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Float32::from_arrow2_opt(arrow_data) + crate::datatypes::Float32::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Float32::from_arrow2(arrow_data) - .map(|v| v.into_iter().map(Self).collect()) + crate::datatypes::Float32::from_arrow(arrow_data).map(|v| v.into_iter().map(Self).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/included_content.rs b/crates/store/re_types/src/blueprint/components/included_content.rs index 1cadd10724f0..20e99faec6a4 100644 --- a/crates/store/re_types/src/blueprint/components/included_content.rs +++ b/crates/store/re_types/src/blueprint/components/included_content.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -57,13 +57,13 @@ impl ::re_types_core::Loggable for IncludedContent { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::EntityPath::from_arrow2_opt(arrow_data) + crate::datatypes::EntityPath::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/interactive.rs b/crates/store/re_types/src/blueprint/components/interactive.rs index 05e3f7ace7f4..fda4f2e449f3 100644 --- a/crates/store/re_types/src/blueprint/components/interactive.rs +++ b/crates/store/re_types/src/blueprint/components/interactive.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -54,13 +54,13 @@ impl ::re_types_core::Loggable for Interactive { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Bool::from_arrow2_opt(arrow_data) + crate::datatypes::Bool::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/lock_range_during_zoom.rs b/crates/store/re_types/src/blueprint/components/lock_range_during_zoom.rs index db8c730d2c55..c5e1ef07d93e 100644 --- a/crates/store/re_types/src/blueprint/components/lock_range_during_zoom.rs +++ b/crates/store/re_types/src/blueprint/components/lock_range_during_zoom.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -54,13 +54,13 @@ impl ::re_types_core::Loggable for LockRangeDuringZoom { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Bool::from_arrow2_opt(arrow_data) + crate::datatypes::Bool::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/map_provider.rs b/crates/store/re_types/src/blueprint/components/map_provider.rs index 7a8e4216ed51..d663a77b5efe 100644 --- a/crates/store/re_types/src/blueprint/components/map_provider.rs +++ b/crates/store/re_types/src/blueprint/components/map_provider.rs @@ -13,7 +13,7 @@ #![allow(clippy::too_many_lines)] #![allow(non_camel_case_types)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -89,16 +89,15 @@ impl ::re_types_core::Loggable for MapProvider { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -109,7 +108,6 @@ impl ::re_types_core::Loggable for MapProvider { }) .with_context("rerun.blueprint.components.MapProvider#enum")? .into_iter() - .map(|opt| opt.copied()) .map(|typ| match typ { Some(1) => Ok(Some(Self::OpenStreetMap)), Some(2) => Ok(Some(Self::MapboxStreets)), diff --git a/crates/store/re_types/src/blueprint/components/near_clip_plane.rs b/crates/store/re_types/src/blueprint/components/near_clip_plane.rs index b9caf19b944d..152c6724fbed 100644 --- a/crates/store/re_types/src/blueprint/components/near_clip_plane.rs +++ b/crates/store/re_types/src/blueprint/components/near_clip_plane.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -55,22 +55,22 @@ impl ::re_types_core::Loggable for NearClipPlane { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Float32::from_arrow2_opt(arrow_data) + crate::datatypes::Float32::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Float32::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Float32::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/blueprint/components/panel_state.rs b/crates/store/re_types/src/blueprint/components/panel_state.rs index 5ed60f06fba7..7bd06b220e5f 100644 --- a/crates/store/re_types/src/blueprint/components/panel_state.rs +++ b/crates/store/re_types/src/blueprint/components/panel_state.rs @@ -13,7 +13,7 @@ #![allow(clippy::too_many_lines)] #![allow(non_camel_case_types)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -86,16 +86,15 @@ impl ::re_types_core::Loggable for PanelState { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -106,7 +105,6 @@ impl ::re_types_core::Loggable for PanelState { }) .with_context("rerun.blueprint.components.PanelState#enum")? .into_iter() - .map(|opt| opt.copied()) .map(|typ| match typ { Some(1) => Ok(Some(Self::Hidden)), Some(2) => Ok(Some(Self::Collapsed)), diff --git a/crates/store/re_types/src/blueprint/components/query_expression.rs b/crates/store/re_types/src/blueprint/components/query_expression.rs index d3684644b5d4..1559679b5ba0 100644 --- a/crates/store/re_types/src/blueprint/components/query_expression.rs +++ b/crates/store/re_types/src/blueprint/components/query_expression.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -61,13 +61,13 @@ impl ::re_types_core::Loggable for QueryExpression { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Utf8::from_arrow2_opt(arrow_data) + crate::datatypes::Utf8::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/root_container.rs b/crates/store/re_types/src/blueprint/components/root_container.rs index be4161f2de22..d981907d9a95 100644 --- a/crates/store/re_types/src/blueprint/components/root_container.rs +++ b/crates/store/re_types/src/blueprint/components/root_container.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -54,22 +54,22 @@ impl ::re_types_core::Loggable for RootContainer { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Uuid::from_arrow2_opt(arrow_data) + crate::datatypes::Uuid::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Uuid::from_arrow2(arrow_data).map(|v| v.into_iter().map(Self).collect()) + crate::datatypes::Uuid::from_arrow(arrow_data).map(|v| v.into_iter().map(Self).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/row_share.rs b/crates/store/re_types/src/blueprint/components/row_share.rs index 290ee9d7ce58..5ba786df400c 100644 --- a/crates/store/re_types/src/blueprint/components/row_share.rs +++ b/crates/store/re_types/src/blueprint/components/row_share.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -54,23 +54,22 @@ impl ::re_types_core::Loggable for RowShare { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Float32::from_arrow2_opt(arrow_data) + crate::datatypes::Float32::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Float32::from_arrow2(arrow_data) - .map(|v| v.into_iter().map(Self).collect()) + crate::datatypes::Float32::from_arrow(arrow_data).map(|v| v.into_iter().map(Self).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/selected_columns.rs b/crates/store/re_types/src/blueprint/components/selected_columns.rs index 31d6e0754b29..0af58e2f2286 100644 --- a/crates/store/re_types/src/blueprint/components/selected_columns.rs +++ b/crates/store/re_types/src/blueprint/components/selected_columns.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,13 +52,13 @@ impl ::re_types_core::Loggable for SelectedColumns { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::blueprint::datatypes::SelectedColumns::from_arrow2_opt(arrow_data) + crate::blueprint::datatypes::SelectedColumns::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/tensor_dimension_index_slider.rs b/crates/store/re_types/src/blueprint/components/tensor_dimension_index_slider.rs index 914bc4e2eca4..d2a1f611a49b 100644 --- a/crates/store/re_types/src/blueprint/components/tensor_dimension_index_slider.rs +++ b/crates/store/re_types/src/blueprint/components/tensor_dimension_index_slider.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -54,13 +54,13 @@ impl ::re_types_core::Loggable for TensorDimensionIndexSlider { )) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::blueprint::datatypes::TensorDimensionIndexSlider::from_arrow2_opt(arrow_data) + crate::blueprint::datatypes::TensorDimensionIndexSlider::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/timeline_name.rs b/crates/store/re_types/src/blueprint/components/timeline_name.rs index efc7f680c876..3cb94e88c29b 100644 --- a/crates/store/re_types/src/blueprint/components/timeline_name.rs +++ b/crates/store/re_types/src/blueprint/components/timeline_name.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,13 +52,13 @@ impl ::re_types_core::Loggable for TimelineName { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Utf8::from_arrow2_opt(arrow_data) + crate::datatypes::Utf8::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/view_class.rs b/crates/store/re_types/src/blueprint/components/view_class.rs index 4496488e546b..370efdde8c39 100644 --- a/crates/store/re_types/src/blueprint/components/view_class.rs +++ b/crates/store/re_types/src/blueprint/components/view_class.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,13 +52,13 @@ impl ::re_types_core::Loggable for ViewClass { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Utf8::from_arrow2_opt(arrow_data) + crate::datatypes::Utf8::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/view_fit.rs b/crates/store/re_types/src/blueprint/components/view_fit.rs index 22d7a8288b1f..cd7ddfa19d91 100644 --- a/crates/store/re_types/src/blueprint/components/view_fit.rs +++ b/crates/store/re_types/src/blueprint/components/view_fit.rs @@ -13,7 +13,7 @@ #![allow(clippy::too_many_lines)] #![allow(non_camel_case_types)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -86,16 +86,15 @@ impl ::re_types_core::Loggable for ViewFit { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -106,7 +105,6 @@ impl ::re_types_core::Loggable for ViewFit { }) .with_context("rerun.blueprint.components.ViewFit#enum")? .into_iter() - .map(|opt| opt.copied()) .map(|typ| match typ { Some(1) => Ok(Some(Self::Original)), Some(2) => Ok(Some(Self::Fill)), diff --git a/crates/store/re_types/src/blueprint/components/view_maximized.rs b/crates/store/re_types/src/blueprint/components/view_maximized.rs index 013b81cebc55..6afcb839590a 100644 --- a/crates/store/re_types/src/blueprint/components/view_maximized.rs +++ b/crates/store/re_types/src/blueprint/components/view_maximized.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -51,22 +51,22 @@ impl ::re_types_core::Loggable for ViewMaximized { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Uuid::from_arrow2_opt(arrow_data) + crate::datatypes::Uuid::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Uuid::from_arrow2(arrow_data).map(|v| v.into_iter().map(Self).collect()) + crate::datatypes::Uuid::from_arrow(arrow_data).map(|v| v.into_iter().map(Self).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/view_origin.rs b/crates/store/re_types/src/blueprint/components/view_origin.rs index 09d16f92615d..7e5864321de4 100644 --- a/crates/store/re_types/src/blueprint/components/view_origin.rs +++ b/crates/store/re_types/src/blueprint/components/view_origin.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,13 +52,13 @@ impl ::re_types_core::Loggable for ViewOrigin { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::EntityPath::from_arrow2_opt(arrow_data) + crate::datatypes::EntityPath::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/viewer_recommendation_hash.rs b/crates/store/re_types/src/blueprint/components/viewer_recommendation_hash.rs index be679b705c38..3488936d0d52 100644 --- a/crates/store/re_types/src/blueprint/components/viewer_recommendation_hash.rs +++ b/crates/store/re_types/src/blueprint/components/viewer_recommendation_hash.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -54,22 +54,22 @@ impl ::re_types_core::Loggable for ViewerRecommendationHash { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::UInt64::from_arrow2_opt(arrow_data) + crate::datatypes::UInt64::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::UInt64::from_arrow2(arrow_data).map(|v| v.into_iter().map(Self).collect()) + crate::datatypes::UInt64::from_arrow(arrow_data).map(|v| v.into_iter().map(Self).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/visible.rs b/crates/store/re_types/src/blueprint/components/visible.rs index c4322a8dbd58..a1c7a59c3698 100644 --- a/crates/store/re_types/src/blueprint/components/visible.rs +++ b/crates/store/re_types/src/blueprint/components/visible.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,13 +52,13 @@ impl ::re_types_core::Loggable for Visible { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Bool::from_arrow2_opt(arrow_data) + crate::datatypes::Bool::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/visible_time_range.rs b/crates/store/re_types/src/blueprint/components/visible_time_range.rs index 4f9685db7677..b7510f5b348e 100644 --- a/crates/store/re_types/src/blueprint/components/visible_time_range.rs +++ b/crates/store/re_types/src/blueprint/components/visible_time_range.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -54,13 +54,13 @@ impl ::re_types_core::Loggable for VisibleTimeRange { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::VisibleTimeRange::from_arrow2_opt(arrow_data) + crate::datatypes::VisibleTimeRange::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/visual_bounds2d.rs b/crates/store/re_types/src/blueprint/components/visual_bounds2d.rs index fefb606c8f46..897ded6af215 100644 --- a/crates/store/re_types/src/blueprint/components/visual_bounds2d.rs +++ b/crates/store/re_types/src/blueprint/components/visual_bounds2d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -55,13 +55,13 @@ impl ::re_types_core::Loggable for VisualBounds2D { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Range2D::from_arrow2_opt(arrow_data) + crate::datatypes::Range2D::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/visualizer_overrides.rs b/crates/store/re_types/src/blueprint/components/visualizer_overrides.rs index 99b03d0960a2..df801cd9c3a6 100644 --- a/crates/store/re_types/src/blueprint/components/visualizer_overrides.rs +++ b/crates/store/re_types/src/blueprint/components/visualizer_overrides.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -64,13 +64,13 @@ impl ::re_types_core::Loggable for VisualizerOverrides { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::blueprint::datatypes::Utf8List::from_arrow2_opt(arrow_data) + crate::blueprint::datatypes::Utf8List::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/blueprint/components/zoom_level.rs b/crates/store/re_types/src/blueprint/components/zoom_level.rs index f25a6decb5b2..bf7f217568cd 100644 --- a/crates/store/re_types/src/blueprint/components/zoom_level.rs +++ b/crates/store/re_types/src/blueprint/components/zoom_level.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -54,23 +54,22 @@ impl ::re_types_core::Loggable for ZoomLevel { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Float64::from_arrow2_opt(arrow_data) + crate::datatypes::Float64::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Float64::from_arrow2(arrow_data) - .map(|v| v.into_iter().map(Self).collect()) + crate::datatypes::Float64::from_arrow(arrow_data).map(|v| v.into_iter().map(Self).collect()) } } diff --git a/crates/store/re_types/src/blueprint/datatypes/component_column_selector.rs b/crates/store/re_types/src/blueprint/datatypes/component_column_selector.rs index dd0694d2ab66..fefbc5238943 100644 --- a/crates/store/re_types/src/blueprint/datatypes/component_column_selector.rs +++ b/crates/store/re_types/src/blueprint/datatypes/component_column_selector.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -155,20 +155,19 @@ impl ::re_types_core::Loggable for ComponentColumnSelector { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -179,10 +178,10 @@ impl ::re_types_core::Loggable for ComponentColumnSelector { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let entity_path = { @@ -197,7 +196,7 @@ impl ::re_types_core::Loggable for ComponentColumnSelector { { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::Utf8; let actual = arrow_data.data_type().clone(); @@ -208,43 +207,39 @@ impl ::re_types_core::Loggable for ComponentColumnSelector { )?; let arrow_data_buf = arrow_data.values(); let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - let len = end - start; - if arrow_data_buf.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_buf.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + let len = end - start; + if arrow_data_buf.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_buf.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = - unsafe { arrow_data_buf.clone().sliced_unchecked(start, len) }; - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = arrow_data_buf.slice_with_length(start, len); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| { - res_or_opt.map(|v| { - crate::datatypes::EntityPath( - ::re_types_core::ArrowString::from(v), - ) + .map(|res_or_opt| { + res_or_opt.map(|res_or_opt| { + res_or_opt.map(|v| { + crate::datatypes::EntityPath( + ::re_types_core::ArrowString::from(v), + ) + }) }) }) - }) - .collect::>>>() - .with_context( - "rerun.blueprint.datatypes.ComponentColumnSelector#entity_path", - )? - .into_iter() + .collect::>>>() + .with_context( + "rerun.blueprint.datatypes.ComponentColumnSelector#entity_path", + )? + .into_iter() } }; let component = { @@ -259,7 +254,7 @@ impl ::re_types_core::Loggable for ComponentColumnSelector { { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::Utf8; let actual = arrow_data.data_type().clone(); @@ -270,46 +265,44 @@ impl ::re_types_core::Loggable for ComponentColumnSelector { )?; let arrow_data_buf = arrow_data.values(); let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - let len = end - start; - if arrow_data_buf.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_buf.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + let len = end - start; + if arrow_data_buf.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_buf.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = - unsafe { arrow_data_buf.clone().sliced_unchecked(start, len) }; - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = arrow_data_buf.slice_with_length(start, len); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| { - res_or_opt.map(|v| { - crate::datatypes::Utf8(::re_types_core::ArrowString::from(v)) + .map(|res_or_opt| { + res_or_opt.map(|res_or_opt| { + res_or_opt.map(|v| { + crate::datatypes::Utf8(::re_types_core::ArrowString::from( + v, + )) + }) }) }) - }) - .collect::>>>() - .with_context( - "rerun.blueprint.datatypes.ComponentColumnSelector#component", - )? - .into_iter() + .collect::>>>() + .with_context( + "rerun.blueprint.datatypes.ComponentColumnSelector#component", + )? + .into_iter() } }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( ::itertools::izip!(entity_path, component), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|opt| { opt.map(|(entity_path, component)| { diff --git a/crates/store/re_types/src/blueprint/datatypes/filter_by_range.rs b/crates/store/re_types/src/blueprint/datatypes/filter_by_range.rs index c74756eaa46e..077e37f54a55 100644 --- a/crates/store/re_types/src/blueprint/datatypes/filter_by_range.rs +++ b/crates/store/re_types/src/blueprint/datatypes/filter_by_range.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -127,20 +127,19 @@ impl ::re_types_core::Loggable for FilterByRange { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -151,10 +150,10 @@ impl ::re_types_core::Loggable for FilterByRange { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let start = { @@ -176,7 +175,6 @@ impl ::re_types_core::Loggable for FilterByRange { }) .with_context("rerun.blueprint.datatypes.FilterByRange#start")? .into_iter() - .map(|opt| opt.copied()) .map(|res_or_opt| res_or_opt.map(crate::datatypes::TimeInt)) }; let end = { @@ -198,28 +196,26 @@ impl ::re_types_core::Loggable for FilterByRange { }) .with_context("rerun.blueprint.datatypes.FilterByRange#end")? .into_iter() - .map(|opt| opt.copied()) .map(|res_or_opt| res_or_opt.map(crate::datatypes::TimeInt)) }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - ::itertools::izip!(start, end), - arrow_data.validity(), - ) - .map(|opt| { - opt.map(|(start, end)| { - Ok(Self { - start: start - .ok_or_else(DeserializationError::missing_data) - .with_context("rerun.blueprint.datatypes.FilterByRange#start")?, - end: end - .ok_or_else(DeserializationError::missing_data) - .with_context("rerun.blueprint.datatypes.FilterByRange#end")?, + ZipValidity::new_with_validity(::itertools::izip!(start, end), arrow_data.nulls()) + .map(|opt| { + opt.map(|(start, end)| { + Ok(Self { + start: start + .ok_or_else(DeserializationError::missing_data) + .with_context( + "rerun.blueprint.datatypes.FilterByRange#start", + )?, + end: end + .ok_or_else(DeserializationError::missing_data) + .with_context("rerun.blueprint.datatypes.FilterByRange#end")?, + }) }) + .transpose() }) - .transpose() - }) - .collect::>>() - .with_context("rerun.blueprint.datatypes.FilterByRange")? + .collect::>>() + .with_context("rerun.blueprint.datatypes.FilterByRange")? } }) } diff --git a/crates/store/re_types/src/blueprint/datatypes/filter_is_not_null.rs b/crates/store/re_types/src/blueprint/datatypes/filter_is_not_null.rs index e747cf1e93f3..677f61a4e744 100644 --- a/crates/store/re_types/src/blueprint/datatypes/filter_is_not_null.rs +++ b/crates/store/re_types/src/blueprint/datatypes/filter_is_not_null.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -125,20 +125,19 @@ impl ::re_types_core::Loggable for FilterIsNotNull { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -149,10 +148,10 @@ impl ::re_types_core::Loggable for FilterIsNotNull { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let active = { @@ -185,15 +184,13 @@ impl ::re_types_core::Loggable for FilterIsNotNull { .with_context("rerun.blueprint.datatypes.FilterIsNotNull"); } let arrow_data = &**arrays_by_name["column"]; - crate::blueprint::datatypes::ComponentColumnSelector::from_arrow2_opt( - arrow_data, - ) - .with_context("rerun.blueprint.datatypes.FilterIsNotNull#column")? - .into_iter() + crate::blueprint::datatypes::ComponentColumnSelector::from_arrow_opt(arrow_data) + .with_context("rerun.blueprint.datatypes.FilterIsNotNull#column")? + .into_iter() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( ::itertools::izip!(active, column), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|opt| { opt.map(|(active, column)| { diff --git a/crates/store/re_types/src/blueprint/datatypes/selected_columns.rs b/crates/store/re_types/src/blueprint/datatypes/selected_columns.rs index 4bb0cec1fea9..38c9066c1048 100644 --- a/crates/store/re_types/src/blueprint/datatypes/selected_columns.rs +++ b/crates/store/re_types/src/blueprint/datatypes/selected_columns.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -190,20 +190,19 @@ impl ::re_types_core::Loggable for SelectedColumns { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -214,10 +213,10 @@ impl ::re_types_core::Loggable for SelectedColumns { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let time_columns = { @@ -232,7 +231,7 @@ impl ::re_types_core::Loggable for SelectedColumns { { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", @@ -253,7 +252,7 @@ impl ::re_types_core::Loggable for SelectedColumns { { let arrow_data_inner = arrow_data_inner .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::Utf8; let actual = arrow_data_inner.data_type().clone(); @@ -264,9 +263,9 @@ impl ::re_types_core::Loggable for SelectedColumns { )?; let arrow_data_inner_buf = arrow_data_inner.values(); let offsets = arrow_data_inner.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( offsets.windows(2), - arrow_data_inner.validity(), + arrow_data_inner.nulls(), ) .map(|elem| { elem @@ -284,9 +283,8 @@ impl ::re_types_core::Loggable for SelectedColumns { } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { - arrow_data_inner_buf.clone().sliced_unchecked(start, len) - }; + let data = arrow_data_inner_buf + .slice_with_length(start, len); Ok(data) }) .transpose() @@ -309,9 +307,9 @@ impl ::re_types_core::Loggable for SelectedColumns { .collect::>() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( offsets.windows(2), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|elem| { elem @@ -357,7 +355,7 @@ impl ::re_types_core::Loggable for SelectedColumns { { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List( std::sync::Arc::new( @@ -379,7 +377,7 @@ impl ::re_types_core::Loggable for SelectedColumns { } else { let arrow_data_inner = { let arrow_data_inner = &**arrow_data.values(); - crate::blueprint::datatypes::ComponentColumnSelector::from_arrow2_opt( + crate::blueprint::datatypes::ComponentColumnSelector::from_arrow_opt( arrow_data_inner, ) .with_context( @@ -389,9 +387,9 @@ impl ::re_types_core::Loggable for SelectedColumns { .collect::>() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( offsets.windows(2), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|elem| { elem @@ -425,9 +423,9 @@ impl ::re_types_core::Loggable for SelectedColumns { .into_iter() } }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( ::itertools::izip!(time_columns, component_columns), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|opt| { opt.map(|(time_columns, component_columns)| { diff --git a/crates/store/re_types/src/blueprint/datatypes/tensor_dimension_index_slider.rs b/crates/store/re_types/src/blueprint/datatypes/tensor_dimension_index_slider.rs index fa525e58dee9..aa89140cf5c9 100644 --- a/crates/store/re_types/src/blueprint/datatypes/tensor_dimension_index_slider.rs +++ b/crates/store/re_types/src/blueprint/datatypes/tensor_dimension_index_slider.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -91,20 +91,19 @@ impl ::re_types_core::Loggable for TensorDimensionIndexSlider { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -115,10 +114,10 @@ impl ::re_types_core::Loggable for TensorDimensionIndexSlider { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let dimension = { @@ -142,26 +141,26 @@ impl ::re_types_core::Loggable for TensorDimensionIndexSlider { "rerun.blueprint.datatypes.TensorDimensionIndexSlider#dimension", )? .into_iter() - .map(|opt| opt.copied()) }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - ::itertools::izip!(dimension), - arrow_data.validity(), - ) - .map(|opt| { - opt.map(|(dimension)| { - Ok(Self { - dimension: dimension - .ok_or_else(DeserializationError::missing_data) - .with_context( - "rerun.blueprint.datatypes.TensorDimensionIndexSlider#dimension", - )?, - }) + ZipValidity::new_with_validity( + ::itertools::izip!(dimension), + arrow_data.nulls(), + ) + .map(|opt| { + opt + .map(|(dimension)| Ok(Self { + dimension: dimension + .ok_or_else(DeserializationError::missing_data) + .with_context( + "rerun.blueprint.datatypes.TensorDimensionIndexSlider#dimension", + )?, + })) + .transpose() }) - .transpose() - }) - .collect::>>() - .with_context("rerun.blueprint.datatypes.TensorDimensionIndexSlider")? + .collect::>>() + .with_context( + "rerun.blueprint.datatypes.TensorDimensionIndexSlider", + )? } }) } diff --git a/crates/store/re_types/src/blueprint/datatypes/utf8list.rs b/crates/store/re_types/src/blueprint/datatypes/utf8list.rs index 1e1d612b53c2..1e6dea965a34 100644 --- a/crates/store/re_types/src/blueprint/datatypes/utf8list.rs +++ b/crates/store/re_types/src/blueprint/datatypes/utf8list.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -91,20 +91,19 @@ impl ::re_types_core::Loggable for Utf8List { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -119,7 +118,7 @@ impl ::re_types_core::Loggable for Utf8List { { let arrow_data_inner = arrow_data_inner .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::Utf8; let actual = arrow_data_inner.data_type().clone(); @@ -128,69 +127,61 @@ impl ::re_types_core::Loggable for Utf8List { .with_context("rerun.blueprint.datatypes.Utf8List#value")?; let arrow_data_inner_buf = arrow_data_inner.values(); let offsets = arrow_data_inner.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data_inner.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - let len = end - start; - if arrow_data_inner_buf.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner_buf.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data_inner.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + let len = end - start; + if arrow_data_inner_buf.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner_buf.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { - arrow_data_inner_buf.clone().sliced_unchecked(start, len) - }; - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = arrow_data_inner_buf.slice_with_length(start, len); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| { - res_or_opt.map(|v| ::re_types_core::ArrowString::from(v)) + .map(|res_or_opt| { + res_or_opt.map(|res_or_opt| { + res_or_opt.map(|v| ::re_types_core::ArrowString::from(v)) + }) }) - }) - .collect::>>>() - .with_context("rerun.blueprint.datatypes.Utf8List#value")? - .into_iter() + .collect::>>>() + .with_context("rerun.blueprint.datatypes.Utf8List#value")? + .into_iter() } .collect::>() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data - .iter() - .cloned() - .map(Option::unwrap_or_default) - .collect(); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data + .iter() + .cloned() + .map(Option::unwrap_or_default) + .collect(); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } diff --git a/crates/store/re_types/src/blueprint/views/bar_chart_view.rs b/crates/store/re_types/src/blueprint/views/bar_chart_view.rs index 6bee621d477e..a58f9728e653 100644 --- a/crates/store/re_types/src/blueprint/views/bar_chart_view.rs +++ b/crates/store/re_types/src/blueprint/views/bar_chart_view.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; diff --git a/crates/store/re_types/src/blueprint/views/dataframe_view.rs b/crates/store/re_types/src/blueprint/views/dataframe_view.rs index 0c2cb2b288ba..799bb8fbedf3 100644 --- a/crates/store/re_types/src/blueprint/views/dataframe_view.rs +++ b/crates/store/re_types/src/blueprint/views/dataframe_view.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; diff --git a/crates/store/re_types/src/blueprint/views/graph_view.rs b/crates/store/re_types/src/blueprint/views/graph_view.rs index 3ff1d79abf64..9728259e84f2 100644 --- a/crates/store/re_types/src/blueprint/views/graph_view.rs +++ b/crates/store/re_types/src/blueprint/views/graph_view.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; diff --git a/crates/store/re_types/src/blueprint/views/map_view.rs b/crates/store/re_types/src/blueprint/views/map_view.rs index 749234094780..658cb13bee12 100644 --- a/crates/store/re_types/src/blueprint/views/map_view.rs +++ b/crates/store/re_types/src/blueprint/views/map_view.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; diff --git a/crates/store/re_types/src/blueprint/views/spatial2d_view.rs b/crates/store/re_types/src/blueprint/views/spatial2d_view.rs index 68dce6e28e47..de7a5def2995 100644 --- a/crates/store/re_types/src/blueprint/views/spatial2d_view.rs +++ b/crates/store/re_types/src/blueprint/views/spatial2d_view.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; diff --git a/crates/store/re_types/src/blueprint/views/spatial3d_view.rs b/crates/store/re_types/src/blueprint/views/spatial3d_view.rs index 8f562935cf37..d754556f738e 100644 --- a/crates/store/re_types/src/blueprint/views/spatial3d_view.rs +++ b/crates/store/re_types/src/blueprint/views/spatial3d_view.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; diff --git a/crates/store/re_types/src/blueprint/views/tensor_view.rs b/crates/store/re_types/src/blueprint/views/tensor_view.rs index efdf00a55232..c7b9dd7d89a9 100644 --- a/crates/store/re_types/src/blueprint/views/tensor_view.rs +++ b/crates/store/re_types/src/blueprint/views/tensor_view.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; diff --git a/crates/store/re_types/src/blueprint/views/text_document_view.rs b/crates/store/re_types/src/blueprint/views/text_document_view.rs index ef82928a58c9..4a7a2c789649 100644 --- a/crates/store/re_types/src/blueprint/views/text_document_view.rs +++ b/crates/store/re_types/src/blueprint/views/text_document_view.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; diff --git a/crates/store/re_types/src/blueprint/views/text_log_view.rs b/crates/store/re_types/src/blueprint/views/text_log_view.rs index 044b5f916b52..2f1a0ac23d0a 100644 --- a/crates/store/re_types/src/blueprint/views/text_log_view.rs +++ b/crates/store/re_types/src/blueprint/views/text_log_view.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; diff --git a/crates/store/re_types/src/blueprint/views/time_series_view.rs b/crates/store/re_types/src/blueprint/views/time_series_view.rs index fc81295ba79e..0b530b6a6a39 100644 --- a/crates/store/re_types/src/blueprint/views/time_series_view.rs +++ b/crates/store/re_types/src/blueprint/views/time_series_view.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; diff --git a/crates/store/re_types/src/components/aggregation_policy.rs b/crates/store/re_types/src/components/aggregation_policy.rs index df61f0eea61c..f4518e6f0fa1 100644 --- a/crates/store/re_types/src/components/aggregation_policy.rs +++ b/crates/store/re_types/src/components/aggregation_policy.rs @@ -13,7 +13,7 @@ #![allow(clippy::too_many_lines)] #![allow(non_camel_case_types)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -101,16 +101,15 @@ impl ::re_types_core::Loggable for AggregationPolicy { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -121,7 +120,6 @@ impl ::re_types_core::Loggable for AggregationPolicy { }) .with_context("rerun.components.AggregationPolicy#enum")? .into_iter() - .map(|opt| opt.copied()) .map(|typ| match typ { Some(1) => Ok(Some(Self::Off)), Some(2) => Ok(Some(Self::Average)), diff --git a/crates/store/re_types/src/components/albedo_factor.rs b/crates/store/re_types/src/components/albedo_factor.rs index 916352c94bd3..fe98ca352477 100644 --- a/crates/store/re_types/src/components/albedo_factor.rs +++ b/crates/store/re_types/src/components/albedo_factor.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -54,22 +54,22 @@ impl ::re_types_core::Loggable for AlbedoFactor { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Rgba32::from_arrow2_opt(arrow_data) + crate::datatypes::Rgba32::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Rgba32::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Rgba32::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/annotation_context.rs b/crates/store/re_types/src/components/annotation_context.rs index c24f64f2d2fd..2b38445f145b 100644 --- a/crates/store/re_types/src/components/annotation_context.rs +++ b/crates/store/re_types/src/components/annotation_context.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -102,20 +102,19 @@ impl ::re_types_core::Loggable for AnnotationContext { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -127,39 +126,36 @@ impl ::re_types_core::Loggable for AnnotationContext { } else { let arrow_data_inner = { let arrow_data_inner = &**arrow_data.values(); - crate::datatypes::ClassDescriptionMapElem::from_arrow2_opt(arrow_data_inner) + crate::datatypes::ClassDescriptionMapElem::from_arrow_opt(arrow_data_inner) .with_context("rerun.components.AnnotationContext#class_map")? .into_iter() .collect::>() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data - .iter() - .cloned() - .map(Option::unwrap_or_default) - .collect(); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data + .iter() + .cloned() + .map(Option::unwrap_or_default) + .collect(); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } diff --git a/crates/store/re_types/src/components/axis_length.rs b/crates/store/re_types/src/components/axis_length.rs index c9c9b7780f14..edbf9ad40ff5 100644 --- a/crates/store/re_types/src/components/axis_length.rs +++ b/crates/store/re_types/src/components/axis_length.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,23 +52,22 @@ impl ::re_types_core::Loggable for AxisLength { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Float32::from_arrow2_opt(arrow_data) + crate::datatypes::Float32::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Float32::from_arrow2(arrow_data) - .map(|v| v.into_iter().map(Self).collect()) + crate::datatypes::Float32::from_arrow(arrow_data).map(|v| v.into_iter().map(Self).collect()) } } diff --git a/crates/store/re_types/src/components/blob.rs b/crates/store/re_types/src/components/blob.rs index d504c0b61537..b8721d80b214 100644 --- a/crates/store/re_types/src/components/blob.rs +++ b/crates/store/re_types/src/components/blob.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -54,13 +54,13 @@ impl ::re_types_core::Loggable for Blob { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Blob::from_arrow2_opt(arrow_data) + crate::datatypes::Blob::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/components/class_id.rs b/crates/store/re_types/src/components/class_id.rs index 3d566e2b07d7..84ae0f56abd2 100644 --- a/crates/store/re_types/src/components/class_id.rs +++ b/crates/store/re_types/src/components/class_id.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -57,22 +57,22 @@ impl ::re_types_core::Loggable for ClassId { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::ClassId::from_arrow2_opt(arrow_data) + crate::datatypes::ClassId::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::ClassId::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::ClassId::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/color.rs b/crates/store/re_types/src/components/color.rs index a7a7c34e5ed9..fafb78b1aea9 100644 --- a/crates/store/re_types/src/components/color.rs +++ b/crates/store/re_types/src/components/color.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -55,22 +55,22 @@ impl ::re_types_core::Loggable for Color { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Rgba32::from_arrow2_opt(arrow_data) + crate::datatypes::Rgba32::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Rgba32::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Rgba32::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/colormap.rs b/crates/store/re_types/src/components/colormap.rs index fca2eccdf2d5..c7acce85106a 100644 --- a/crates/store/re_types/src/components/colormap.rs +++ b/crates/store/re_types/src/components/colormap.rs @@ -13,7 +13,7 @@ #![allow(clippy::too_many_lines)] #![allow(non_camel_case_types)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -125,16 +125,15 @@ impl ::re_types_core::Loggable for Colormap { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -145,7 +144,6 @@ impl ::re_types_core::Loggable for Colormap { }) .with_context("rerun.components.Colormap#enum")? .into_iter() - .map(|opt| opt.copied()) .map(|typ| match typ { Some(1) => Ok(Some(Self::Grayscale)), Some(2) => Ok(Some(Self::Inferno)), diff --git a/crates/store/re_types/src/components/depth_meter.rs b/crates/store/re_types/src/components/depth_meter.rs index 45706c7b4932..25822212e164 100644 --- a/crates/store/re_types/src/components/depth_meter.rs +++ b/crates/store/re_types/src/components/depth_meter.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -59,22 +59,22 @@ impl ::re_types_core::Loggable for DepthMeter { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Float32::from_arrow2_opt(arrow_data) + crate::datatypes::Float32::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Float32::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Float32::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/disconnected_space.rs b/crates/store/re_types/src/components/disconnected_space.rs index cec09ea9d318..f3a878790f18 100644 --- a/crates/store/re_types/src/components/disconnected_space.rs +++ b/crates/store/re_types/src/components/disconnected_space.rs @@ -13,7 +13,7 @@ #![allow(clippy::too_many_lines)] #![allow(deprecated)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -65,13 +65,13 @@ impl ::re_types_core::Loggable for DisconnectedSpace { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Bool::from_arrow2_opt(arrow_data) + crate::datatypes::Bool::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/components/draw_order.rs b/crates/store/re_types/src/components/draw_order.rs index 3e745d780a41..08d30f26d133 100644 --- a/crates/store/re_types/src/components/draw_order.rs +++ b/crates/store/re_types/src/components/draw_order.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -57,23 +57,22 @@ impl ::re_types_core::Loggable for DrawOrder { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Float32::from_arrow2_opt(arrow_data) + crate::datatypes::Float32::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Float32::from_arrow2(arrow_data) - .map(|v| v.into_iter().map(Self).collect()) + crate::datatypes::Float32::from_arrow(arrow_data).map(|v| v.into_iter().map(Self).collect()) } } diff --git a/crates/store/re_types/src/components/entity_path.rs b/crates/store/re_types/src/components/entity_path.rs index 4c1b63c5fac6..ed98a3664cc9 100644 --- a/crates/store/re_types/src/components/entity_path.rs +++ b/crates/store/re_types/src/components/entity_path.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,13 +52,13 @@ impl ::re_types_core::Loggable for EntityPath { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::EntityPath::from_arrow2_opt(arrow_data) + crate::datatypes::EntityPath::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/components/fill_mode.rs b/crates/store/re_types/src/components/fill_mode.rs index 62626d83d9ed..13184d78227d 100644 --- a/crates/store/re_types/src/components/fill_mode.rs +++ b/crates/store/re_types/src/components/fill_mode.rs @@ -13,7 +13,7 @@ #![allow(clippy::too_many_lines)] #![allow(non_camel_case_types)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -98,16 +98,15 @@ impl ::re_types_core::Loggable for FillMode { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -118,7 +117,6 @@ impl ::re_types_core::Loggable for FillMode { }) .with_context("rerun.components.FillMode#enum")? .into_iter() - .map(|opt| opt.copied()) .map(|typ| match typ { Some(1) => Ok(Some(Self::MajorWireframe)), Some(2) => Ok(Some(Self::DenseWireframe)), diff --git a/crates/store/re_types/src/components/fill_ratio.rs b/crates/store/re_types/src/components/fill_ratio.rs index 00232aacb8be..029b694727ec 100644 --- a/crates/store/re_types/src/components/fill_ratio.rs +++ b/crates/store/re_types/src/components/fill_ratio.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -57,22 +57,22 @@ impl ::re_types_core::Loggable for FillRatio { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Float32::from_arrow2_opt(arrow_data) + crate::datatypes::Float32::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Float32::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Float32::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/gamma_correction.rs b/crates/store/re_types/src/components/gamma_correction.rs index 2237888deb1f..06a3eca31651 100644 --- a/crates/store/re_types/src/components/gamma_correction.rs +++ b/crates/store/re_types/src/components/gamma_correction.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -58,22 +58,22 @@ impl ::re_types_core::Loggable for GammaCorrection { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Float32::from_arrow2_opt(arrow_data) + crate::datatypes::Float32::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Float32::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Float32::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/geo_line_string.rs b/crates/store/re_types/src/components/geo_line_string.rs index 09348a64d66f..1fbd8ebe681b 100644 --- a/crates/store/re_types/src/components/geo_line_string.rs +++ b/crates/store/re_types/src/components/geo_line_string.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -108,20 +108,19 @@ impl ::re_types_core::Loggable for GeoLineString { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -136,7 +135,7 @@ impl ::re_types_core::Loggable for GeoLineString { { let arrow_data_inner = arrow_data_inner .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::FixedSizeList( std::sync::Arc::new(Field::new( @@ -168,72 +167,67 @@ impl ::re_types_core::Loggable for GeoLineString { }) .with_context("rerun.components.GeoLineString#lat_lon")? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets, - arrow_data_inner.validity(), - ) - .map(|elem| { - elem.map(|(start, end): (usize, usize)| { - debug_assert!(end - start == 2usize); - if end > arrow_data_inner_inner.len() { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets, arrow_data_inner.nulls()) + .map(|elem| { + elem.map(|(start, end): (usize, usize)| { + debug_assert!(end - start == 2usize); + if arrow_data_inner_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = - unsafe { arrow_data_inner_inner.get_unchecked(start..end) }; - let data = data.iter().cloned().map(Option::unwrap_or_default); + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { + arrow_data_inner_inner.get_unchecked(start..end) + }; + let data = + data.iter().cloned().map(Option::unwrap_or_default); - // NOTE: Unwrapping cannot fail: the length must be correct. - #[allow(clippy::unwrap_used)] - Ok(array_init::from_iter(data).unwrap()) + // NOTE: Unwrapping cannot fail: the length must be correct. + #[allow(clippy::unwrap_used)] + Ok(array_init::from_iter(data).unwrap()) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt - .map(|res_or_opt| res_or_opt.map(crate::datatypes::DVec2D)) - }) - .collect::>>>()? + .map(|res_or_opt| { + res_or_opt + .map(|res_or_opt| res_or_opt.map(crate::datatypes::DVec2D)) + }) + .collect::>>>()? } .into_iter() } .collect::>() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data - .iter() - .cloned() - .map(Option::unwrap_or_default) - .collect(); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data + .iter() + .cloned() + .map(Option::unwrap_or_default) + .collect(); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } diff --git a/crates/store/re_types/src/components/graph_edge.rs b/crates/store/re_types/src/components/graph_edge.rs index 2fb1838a1d5f..1af7d3001a1b 100644 --- a/crates/store/re_types/src/components/graph_edge.rs +++ b/crates/store/re_types/src/components/graph_edge.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,13 +52,13 @@ impl ::re_types_core::Loggable for GraphEdge { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Utf8Pair::from_arrow2_opt(arrow_data) + crate::datatypes::Utf8Pair::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/components/graph_node.rs b/crates/store/re_types/src/components/graph_node.rs index 89480d1e0983..14363ae4bad0 100644 --- a/crates/store/re_types/src/components/graph_node.rs +++ b/crates/store/re_types/src/components/graph_node.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,13 +52,13 @@ impl ::re_types_core::Loggable for GraphNode { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Utf8::from_arrow2_opt(arrow_data) + crate::datatypes::Utf8::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/components/graph_type.rs b/crates/store/re_types/src/components/graph_type.rs index 6436a08dc0f9..5220e27aa9fa 100644 --- a/crates/store/re_types/src/components/graph_type.rs +++ b/crates/store/re_types/src/components/graph_type.rs @@ -13,7 +13,7 @@ #![allow(clippy::too_many_lines)] #![allow(non_camel_case_types)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -83,16 +83,15 @@ impl ::re_types_core::Loggable for GraphType { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -103,7 +102,6 @@ impl ::re_types_core::Loggable for GraphType { }) .with_context("rerun.components.GraphType#enum")? .into_iter() - .map(|opt| opt.copied()) .map(|typ| match typ { Some(1) => Ok(Some(Self::Undirected)), Some(2) => Ok(Some(Self::Directed)), diff --git a/crates/store/re_types/src/components/half_size2d.rs b/crates/store/re_types/src/components/half_size2d.rs index 14d5cb88b206..d87c811030a0 100644 --- a/crates/store/re_types/src/components/half_size2d.rs +++ b/crates/store/re_types/src/components/half_size2d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -57,22 +57,22 @@ impl ::re_types_core::Loggable for HalfSize2D { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Vec2D::from_arrow2_opt(arrow_data) + crate::datatypes::Vec2D::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Vec2D::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Vec2D::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/half_size3d.rs b/crates/store/re_types/src/components/half_size3d.rs index 998bf7e53ed7..9b93ef637fa1 100644 --- a/crates/store/re_types/src/components/half_size3d.rs +++ b/crates/store/re_types/src/components/half_size3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -57,22 +57,22 @@ impl ::re_types_core::Loggable for HalfSize3D { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Vec3D::from_arrow2_opt(arrow_data) + crate::datatypes::Vec3D::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Vec3D::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Vec3D::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/image_buffer.rs b/crates/store/re_types/src/components/image_buffer.rs index 9d1e41bd2f56..67f0a23d3183 100644 --- a/crates/store/re_types/src/components/image_buffer.rs +++ b/crates/store/re_types/src/components/image_buffer.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -54,13 +54,13 @@ impl ::re_types_core::Loggable for ImageBuffer { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Blob::from_arrow2_opt(arrow_data) + crate::datatypes::Blob::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/components/image_format.rs b/crates/store/re_types/src/components/image_format.rs index 2d591a3903d9..ca29cd069279 100644 --- a/crates/store/re_types/src/components/image_format.rs +++ b/crates/store/re_types/src/components/image_format.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,13 +52,13 @@ impl ::re_types_core::Loggable for ImageFormat { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::ImageFormat::from_arrow2_opt(arrow_data) + crate::datatypes::ImageFormat::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/components/image_plane_distance.rs b/crates/store/re_types/src/components/image_plane_distance.rs index 0ff93ed36d56..ca68618c76c2 100644 --- a/crates/store/re_types/src/components/image_plane_distance.rs +++ b/crates/store/re_types/src/components/image_plane_distance.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -53,23 +53,22 @@ impl ::re_types_core::Loggable for ImagePlaneDistance { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Float32::from_arrow2_opt(arrow_data) + crate::datatypes::Float32::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Float32::from_arrow2(arrow_data) - .map(|v| v.into_iter().map(Self).collect()) + crate::datatypes::Float32::from_arrow(arrow_data).map(|v| v.into_iter().map(Self).collect()) } } diff --git a/crates/store/re_types/src/components/keypoint_id.rs b/crates/store/re_types/src/components/keypoint_id.rs index b8d74796b611..d0084f5e3ed9 100644 --- a/crates/store/re_types/src/components/keypoint_id.rs +++ b/crates/store/re_types/src/components/keypoint_id.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -69,22 +69,22 @@ impl ::re_types_core::Loggable for KeypointId { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::KeypointId::from_arrow2_opt(arrow_data) + crate::datatypes::KeypointId::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::KeypointId::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::KeypointId::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/lat_lon.rs b/crates/store/re_types/src/components/lat_lon.rs index 3368b23b8b5e..3a235f80f955 100644 --- a/crates/store/re_types/src/components/lat_lon.rs +++ b/crates/store/re_types/src/components/lat_lon.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,22 +52,22 @@ impl ::re_types_core::Loggable for LatLon { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::DVec2D::from_arrow2_opt(arrow_data) + crate::datatypes::DVec2D::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::DVec2D::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::DVec2D::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/length.rs b/crates/store/re_types/src/components/length.rs index 5ca84903e046..36e005a9a855 100644 --- a/crates/store/re_types/src/components/length.rs +++ b/crates/store/re_types/src/components/length.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -55,22 +55,22 @@ impl ::re_types_core::Loggable for Length { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Float32::from_arrow2_opt(arrow_data) + crate::datatypes::Float32::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Float32::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Float32::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/line_strip2d.rs b/crates/store/re_types/src/components/line_strip2d.rs index fcac594ffd8e..5d489bfeb4e9 100644 --- a/crates/store/re_types/src/components/line_strip2d.rs +++ b/crates/store/re_types/src/components/line_strip2d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -118,20 +118,19 @@ impl ::re_types_core::Loggable for LineStrip2D { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -146,7 +145,7 @@ impl ::re_types_core::Loggable for LineStrip2D { { let arrow_data_inner = arrow_data_inner .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::FixedSizeList( std::sync::Arc::new(Field::new( @@ -178,71 +177,67 @@ impl ::re_types_core::Loggable for LineStrip2D { }) .with_context("rerun.components.LineStrip2D#points")? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets, - arrow_data_inner.validity(), - ) - .map(|elem| { - elem.map(|(start, end): (usize, usize)| { - debug_assert!(end - start == 2usize); - if end > arrow_data_inner_inner.len() { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets, arrow_data_inner.nulls()) + .map(|elem| { + elem.map(|(start, end): (usize, usize)| { + debug_assert!(end - start == 2usize); + if arrow_data_inner_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = - unsafe { arrow_data_inner_inner.get_unchecked(start..end) }; - let data = data.iter().cloned().map(Option::unwrap_or_default); + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { + arrow_data_inner_inner.get_unchecked(start..end) + }; + let data = + data.iter().cloned().map(Option::unwrap_or_default); - // NOTE: Unwrapping cannot fail: the length must be correct. - #[allow(clippy::unwrap_used)] - Ok(array_init::from_iter(data).unwrap()) + // NOTE: Unwrapping cannot fail: the length must be correct. + #[allow(clippy::unwrap_used)] + Ok(array_init::from_iter(data).unwrap()) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| res_or_opt.map(crate::datatypes::Vec2D)) - }) - .collect::>>>()? + .map(|res_or_opt| { + res_or_opt + .map(|res_or_opt| res_or_opt.map(crate::datatypes::Vec2D)) + }) + .collect::>>>()? } .into_iter() } .collect::>() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data - .iter() - .cloned() - .map(Option::unwrap_or_default) - .collect(); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data + .iter() + .cloned() + .map(Option::unwrap_or_default) + .collect(); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } diff --git a/crates/store/re_types/src/components/line_strip3d.rs b/crates/store/re_types/src/components/line_strip3d.rs index 97e579575bc7..c98f004acbbb 100644 --- a/crates/store/re_types/src/components/line_strip3d.rs +++ b/crates/store/re_types/src/components/line_strip3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -118,20 +118,19 @@ impl ::re_types_core::Loggable for LineStrip3D { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -146,7 +145,7 @@ impl ::re_types_core::Loggable for LineStrip3D { { let arrow_data_inner = arrow_data_inner .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::FixedSizeList( std::sync::Arc::new(Field::new( @@ -178,71 +177,67 @@ impl ::re_types_core::Loggable for LineStrip3D { }) .with_context("rerun.components.LineStrip3D#points")? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets, - arrow_data_inner.validity(), - ) - .map(|elem| { - elem.map(|(start, end): (usize, usize)| { - debug_assert!(end - start == 3usize); - if end > arrow_data_inner_inner.len() { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets, arrow_data_inner.nulls()) + .map(|elem| { + elem.map(|(start, end): (usize, usize)| { + debug_assert!(end - start == 3usize); + if arrow_data_inner_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = - unsafe { arrow_data_inner_inner.get_unchecked(start..end) }; - let data = data.iter().cloned().map(Option::unwrap_or_default); + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { + arrow_data_inner_inner.get_unchecked(start..end) + }; + let data = + data.iter().cloned().map(Option::unwrap_or_default); - // NOTE: Unwrapping cannot fail: the length must be correct. - #[allow(clippy::unwrap_used)] - Ok(array_init::from_iter(data).unwrap()) + // NOTE: Unwrapping cannot fail: the length must be correct. + #[allow(clippy::unwrap_used)] + Ok(array_init::from_iter(data).unwrap()) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| res_or_opt.map(crate::datatypes::Vec3D)) - }) - .collect::>>>()? + .map(|res_or_opt| { + res_or_opt + .map(|res_or_opt| res_or_opt.map(crate::datatypes::Vec3D)) + }) + .collect::>>>()? } .into_iter() } .collect::>() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data - .iter() - .cloned() - .map(Option::unwrap_or_default) - .collect(); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data + .iter() + .cloned() + .map(Option::unwrap_or_default) + .collect(); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } diff --git a/crates/store/re_types/src/components/magnification_filter.rs b/crates/store/re_types/src/components/magnification_filter.rs index ae48e1ac332c..c95cf61f1b67 100644 --- a/crates/store/re_types/src/components/magnification_filter.rs +++ b/crates/store/re_types/src/components/magnification_filter.rs @@ -13,7 +13,7 @@ #![allow(clippy::too_many_lines)] #![allow(non_camel_case_types)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -88,16 +88,15 @@ impl ::re_types_core::Loggable for MagnificationFilter { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -108,7 +107,6 @@ impl ::re_types_core::Loggable for MagnificationFilter { }) .with_context("rerun.components.MagnificationFilter#enum")? .into_iter() - .map(|opt| opt.copied()) .map(|typ| match typ { Some(1) => Ok(Some(Self::Nearest)), Some(2) => Ok(Some(Self::Linear)), diff --git a/crates/store/re_types/src/components/marker_shape.rs b/crates/store/re_types/src/components/marker_shape.rs index 2a85ca01bf3f..e3abad5a30d9 100644 --- a/crates/store/re_types/src/components/marker_shape.rs +++ b/crates/store/re_types/src/components/marker_shape.rs @@ -13,7 +13,7 @@ #![allow(clippy::too_many_lines)] #![allow(non_camel_case_types)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -107,16 +107,15 @@ impl ::re_types_core::Loggable for MarkerShape { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -127,7 +126,6 @@ impl ::re_types_core::Loggable for MarkerShape { }) .with_context("rerun.components.MarkerShape#enum")? .into_iter() - .map(|opt| opt.copied()) .map(|typ| match typ { Some(1) => Ok(Some(Self::Circle)), Some(2) => Ok(Some(Self::Diamond)), diff --git a/crates/store/re_types/src/components/marker_size.rs b/crates/store/re_types/src/components/marker_size.rs index a426cc42a194..57aa17a52cbc 100644 --- a/crates/store/re_types/src/components/marker_size.rs +++ b/crates/store/re_types/src/components/marker_size.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,22 +52,22 @@ impl ::re_types_core::Loggable for MarkerSize { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Float32::from_arrow2_opt(arrow_data) + crate::datatypes::Float32::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Float32::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Float32::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/media_type.rs b/crates/store/re_types/src/components/media_type.rs index d8fb05969340..5a9a006930f7 100644 --- a/crates/store/re_types/src/components/media_type.rs +++ b/crates/store/re_types/src/components/media_type.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -55,13 +55,13 @@ impl ::re_types_core::Loggable for MediaType { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Utf8::from_arrow2_opt(arrow_data) + crate::datatypes::Utf8::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/components/name.rs b/crates/store/re_types/src/components/name.rs index c6c0241188a8..6f878e48d6b9 100644 --- a/crates/store/re_types/src/components/name.rs +++ b/crates/store/re_types/src/components/name.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,13 +52,13 @@ impl ::re_types_core::Loggable for Name { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Utf8::from_arrow2_opt(arrow_data) + crate::datatypes::Utf8::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/components/opacity.rs b/crates/store/re_types/src/components/opacity.rs index 822156726101..852f53f84770 100644 --- a/crates/store/re_types/src/components/opacity.rs +++ b/crates/store/re_types/src/components/opacity.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -55,22 +55,22 @@ impl ::re_types_core::Loggable for Opacity { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Float32::from_arrow2_opt(arrow_data) + crate::datatypes::Float32::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Float32::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Float32::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/pinhole_projection.rs b/crates/store/re_types/src/components/pinhole_projection.rs index 61e2bb43aa1d..1214fcfd3e7d 100644 --- a/crates/store/re_types/src/components/pinhole_projection.rs +++ b/crates/store/re_types/src/components/pinhole_projection.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -61,22 +61,22 @@ impl ::re_types_core::Loggable for PinholeProjection { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Mat3x3::from_arrow2_opt(arrow_data) + crate::datatypes::Mat3x3::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Mat3x3::from_arrow2(arrow_data).map(|v| v.into_iter().map(Self).collect()) + crate::datatypes::Mat3x3::from_arrow(arrow_data).map(|v| v.into_iter().map(Self).collect()) } } diff --git a/crates/store/re_types/src/components/plane3d.rs b/crates/store/re_types/src/components/plane3d.rs index 3db060645004..dd9187c60d0e 100644 --- a/crates/store/re_types/src/components/plane3d.rs +++ b/crates/store/re_types/src/components/plane3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -60,22 +60,22 @@ impl ::re_types_core::Loggable for Plane3D { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Plane3D::from_arrow2_opt(arrow_data) + crate::datatypes::Plane3D::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Plane3D::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Plane3D::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/pose_rotation_axis_angle.rs b/crates/store/re_types/src/components/pose_rotation_axis_angle.rs index 3aa09bef378b..1dbe3f0c20fd 100644 --- a/crates/store/re_types/src/components/pose_rotation_axis_angle.rs +++ b/crates/store/re_types/src/components/pose_rotation_axis_angle.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -54,13 +54,13 @@ impl ::re_types_core::Loggable for PoseRotationAxisAngle { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::RotationAxisAngle::from_arrow2_opt(arrow_data) + crate::datatypes::RotationAxisAngle::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/components/pose_rotation_quat.rs b/crates/store/re_types/src/components/pose_rotation_quat.rs index 964700df594d..8e42ed4bb598 100644 --- a/crates/store/re_types/src/components/pose_rotation_quat.rs +++ b/crates/store/re_types/src/components/pose_rotation_quat.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -56,22 +56,22 @@ impl ::re_types_core::Loggable for PoseRotationQuat { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Quaternion::from_arrow2_opt(arrow_data) + crate::datatypes::Quaternion::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Quaternion::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Quaternion::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/pose_scale3d.rs b/crates/store/re_types/src/components/pose_scale3d.rs index 3ef25810010c..21f221859199 100644 --- a/crates/store/re_types/src/components/pose_scale3d.rs +++ b/crates/store/re_types/src/components/pose_scale3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -56,22 +56,22 @@ impl ::re_types_core::Loggable for PoseScale3D { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Vec3D::from_arrow2_opt(arrow_data) + crate::datatypes::Vec3D::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Vec3D::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Vec3D::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/pose_transform_mat3x3.rs b/crates/store/re_types/src/components/pose_transform_mat3x3.rs index 2c2f3b9295f8..d7b3ab784c0e 100644 --- a/crates/store/re_types/src/components/pose_transform_mat3x3.rs +++ b/crates/store/re_types/src/components/pose_transform_mat3x3.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -64,22 +64,22 @@ impl ::re_types_core::Loggable for PoseTransformMat3x3 { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Mat3x3::from_arrow2_opt(arrow_data) + crate::datatypes::Mat3x3::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Mat3x3::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Mat3x3::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/pose_translation3d.rs b/crates/store/re_types/src/components/pose_translation3d.rs index efde8a24c595..d8976720a203 100644 --- a/crates/store/re_types/src/components/pose_translation3d.rs +++ b/crates/store/re_types/src/components/pose_translation3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,22 +52,22 @@ impl ::re_types_core::Loggable for PoseTranslation3D { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Vec3D::from_arrow2_opt(arrow_data) + crate::datatypes::Vec3D::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Vec3D::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Vec3D::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/position2d.rs b/crates/store/re_types/src/components/position2d.rs index 94790a01a4f3..2b6da1f6eaf3 100644 --- a/crates/store/re_types/src/components/position2d.rs +++ b/crates/store/re_types/src/components/position2d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,22 +52,22 @@ impl ::re_types_core::Loggable for Position2D { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Vec2D::from_arrow2_opt(arrow_data) + crate::datatypes::Vec2D::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Vec2D::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Vec2D::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/position3d.rs b/crates/store/re_types/src/components/position3d.rs index 6b89098bfa51..b371a0a931b8 100644 --- a/crates/store/re_types/src/components/position3d.rs +++ b/crates/store/re_types/src/components/position3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,22 +52,22 @@ impl ::re_types_core::Loggable for Position3D { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Vec3D::from_arrow2_opt(arrow_data) + crate::datatypes::Vec3D::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Vec3D::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Vec3D::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/radius.rs b/crates/store/re_types/src/components/radius.rs index 06b071e198ff..3e10e9724a11 100644 --- a/crates/store/re_types/src/components/radius.rs +++ b/crates/store/re_types/src/components/radius.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -59,22 +59,22 @@ impl ::re_types_core::Loggable for Radius { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Float32::from_arrow2_opt(arrow_data) + crate::datatypes::Float32::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Float32::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Float32::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/range1d.rs b/crates/store/re_types/src/components/range1d.rs index 0936cd7685de..42e69b20a86a 100644 --- a/crates/store/re_types/src/components/range1d.rs +++ b/crates/store/re_types/src/components/range1d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,22 +52,22 @@ impl ::re_types_core::Loggable for Range1D { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Range1D::from_arrow2_opt(arrow_data) + crate::datatypes::Range1D::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Range1D::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Range1D::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/recording_uri.rs b/crates/store/re_types/src/components/recording_uri.rs index 4dd097489830..7ba4be07f3f1 100644 --- a/crates/store/re_types/src/components/recording_uri.rs +++ b/crates/store/re_types/src/components/recording_uri.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -51,13 +51,13 @@ impl ::re_types_core::Loggable for RecordingUri { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Utf8::from_arrow2_opt(arrow_data) + crate::datatypes::Utf8::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/components/resolution.rs b/crates/store/re_types/src/components/resolution.rs index 4ac815733c70..04afd9ceeaa6 100644 --- a/crates/store/re_types/src/components/resolution.rs +++ b/crates/store/re_types/src/components/resolution.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -53,22 +53,22 @@ impl ::re_types_core::Loggable for Resolution { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Vec2D::from_arrow2_opt(arrow_data) + crate::datatypes::Vec2D::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Vec2D::from_arrow2(arrow_data).map(|v| v.into_iter().map(Self).collect()) + crate::datatypes::Vec2D::from_arrow(arrow_data).map(|v| v.into_iter().map(Self).collect()) } } diff --git a/crates/store/re_types/src/components/rotation_axis_angle.rs b/crates/store/re_types/src/components/rotation_axis_angle.rs index 21dafdc16441..91652da60bf4 100644 --- a/crates/store/re_types/src/components/rotation_axis_angle.rs +++ b/crates/store/re_types/src/components/rotation_axis_angle.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -54,13 +54,13 @@ impl ::re_types_core::Loggable for RotationAxisAngle { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::RotationAxisAngle::from_arrow2_opt(arrow_data) + crate::datatypes::RotationAxisAngle::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/components/rotation_quat.rs b/crates/store/re_types/src/components/rotation_quat.rs index 0ee536178c0b..c513eaa7ba5a 100644 --- a/crates/store/re_types/src/components/rotation_quat.rs +++ b/crates/store/re_types/src/components/rotation_quat.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -56,22 +56,22 @@ impl ::re_types_core::Loggable for RotationQuat { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Quaternion::from_arrow2_opt(arrow_data) + crate::datatypes::Quaternion::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Quaternion::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Quaternion::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/scalar.rs b/crates/store/re_types/src/components/scalar.rs index 97e1f3e9384e..961f0aa86812 100644 --- a/crates/store/re_types/src/components/scalar.rs +++ b/crates/store/re_types/src/components/scalar.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -54,22 +54,22 @@ impl ::re_types_core::Loggable for Scalar { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Float64::from_arrow2_opt(arrow_data) + crate::datatypes::Float64::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Float64::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Float64::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/scale3d.rs b/crates/store/re_types/src/components/scale3d.rs index 064c4051c1b5..86a596368323 100644 --- a/crates/store/re_types/src/components/scale3d.rs +++ b/crates/store/re_types/src/components/scale3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -56,22 +56,22 @@ impl ::re_types_core::Loggable for Scale3D { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Vec3D::from_arrow2_opt(arrow_data) + crate::datatypes::Vec3D::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Vec3D::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Vec3D::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/show_labels.rs b/crates/store/re_types/src/components/show_labels.rs index 949c39f8967c..c8773e1e8bc2 100644 --- a/crates/store/re_types/src/components/show_labels.rs +++ b/crates/store/re_types/src/components/show_labels.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -58,13 +58,13 @@ impl ::re_types_core::Loggable for ShowLabels { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Bool::from_arrow2_opt(arrow_data) + crate::datatypes::Bool::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/components/stroke_width.rs b/crates/store/re_types/src/components/stroke_width.rs index 08093d9fab09..7b49c6fce958 100644 --- a/crates/store/re_types/src/components/stroke_width.rs +++ b/crates/store/re_types/src/components/stroke_width.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,22 +52,22 @@ impl ::re_types_core::Loggable for StrokeWidth { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Float32::from_arrow2_opt(arrow_data) + crate::datatypes::Float32::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Float32::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Float32::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/tensor_data.rs b/crates/store/re_types/src/components/tensor_data.rs index 63d7604643e6..6f480ca76e18 100644 --- a/crates/store/re_types/src/components/tensor_data.rs +++ b/crates/store/re_types/src/components/tensor_data.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -59,13 +59,13 @@ impl ::re_types_core::Loggable for TensorData { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::TensorData::from_arrow2_opt(arrow_data) + crate::datatypes::TensorData::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/components/tensor_dimension_index_selection.rs b/crates/store/re_types/src/components/tensor_dimension_index_selection.rs index 6efd104a5685..a8dc8180b105 100644 --- a/crates/store/re_types/src/components/tensor_dimension_index_selection.rs +++ b/crates/store/re_types/src/components/tensor_dimension_index_selection.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -54,13 +54,13 @@ impl ::re_types_core::Loggable for TensorDimensionIndexSelection { )) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::TensorDimensionIndexSelection::from_arrow2_opt(arrow_data) + crate::datatypes::TensorDimensionIndexSelection::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/components/tensor_height_dimension.rs b/crates/store/re_types/src/components/tensor_height_dimension.rs index e6d43551fb98..8e1cbe641dcd 100644 --- a/crates/store/re_types/src/components/tensor_height_dimension.rs +++ b/crates/store/re_types/src/components/tensor_height_dimension.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,13 +52,13 @@ impl ::re_types_core::Loggable for TensorHeightDimension { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::TensorDimensionSelection::from_arrow2_opt(arrow_data) + crate::datatypes::TensorDimensionSelection::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/components/tensor_width_dimension.rs b/crates/store/re_types/src/components/tensor_width_dimension.rs index 1731d8d77924..3ba8704c4df5 100644 --- a/crates/store/re_types/src/components/tensor_width_dimension.rs +++ b/crates/store/re_types/src/components/tensor_width_dimension.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,13 +52,13 @@ impl ::re_types_core::Loggable for TensorWidthDimension { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::TensorDimensionSelection::from_arrow2_opt(arrow_data) + crate::datatypes::TensorDimensionSelection::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/components/texcoord2d.rs b/crates/store/re_types/src/components/texcoord2d.rs index ff48187042d3..67fe8df519fd 100644 --- a/crates/store/re_types/src/components/texcoord2d.rs +++ b/crates/store/re_types/src/components/texcoord2d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -67,22 +67,22 @@ impl ::re_types_core::Loggable for Texcoord2D { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Vec2D::from_arrow2_opt(arrow_data) + crate::datatypes::Vec2D::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Vec2D::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Vec2D::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/text.rs b/crates/store/re_types/src/components/text.rs index eba8cd4c5525..938ed9cc4afe 100644 --- a/crates/store/re_types/src/components/text.rs +++ b/crates/store/re_types/src/components/text.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,13 +52,13 @@ impl ::re_types_core::Loggable for Text { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Utf8::from_arrow2_opt(arrow_data) + crate::datatypes::Utf8::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/components/text_log_level.rs b/crates/store/re_types/src/components/text_log_level.rs index 991a59b9bb7c..8c78aa1de2c8 100644 --- a/crates/store/re_types/src/components/text_log_level.rs +++ b/crates/store/re_types/src/components/text_log_level.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -60,13 +60,13 @@ impl ::re_types_core::Loggable for TextLogLevel { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Utf8::from_arrow2_opt(arrow_data) + crate::datatypes::Utf8::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/components/transform_mat3x3.rs b/crates/store/re_types/src/components/transform_mat3x3.rs index fc9671de6afc..56f5775a4244 100644 --- a/crates/store/re_types/src/components/transform_mat3x3.rs +++ b/crates/store/re_types/src/components/transform_mat3x3.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -64,22 +64,22 @@ impl ::re_types_core::Loggable for TransformMat3x3 { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Mat3x3::from_arrow2_opt(arrow_data) + crate::datatypes::Mat3x3::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Mat3x3::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Mat3x3::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/transform_relation.rs b/crates/store/re_types/src/components/transform_relation.rs index 4fcd383ef19d..56717f742e2d 100644 --- a/crates/store/re_types/src/components/transform_relation.rs +++ b/crates/store/re_types/src/components/transform_relation.rs @@ -13,7 +13,7 @@ #![allow(clippy::too_many_lines)] #![allow(non_camel_case_types)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -91,16 +91,15 @@ impl ::re_types_core::Loggable for TransformRelation { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -111,7 +110,6 @@ impl ::re_types_core::Loggable for TransformRelation { }) .with_context("rerun.components.TransformRelation#enum")? .into_iter() - .map(|opt| opt.copied()) .map(|typ| match typ { Some(1) => Ok(Some(Self::ParentFromChild)), Some(2) => Ok(Some(Self::ChildFromParent)), diff --git a/crates/store/re_types/src/components/translation3d.rs b/crates/store/re_types/src/components/translation3d.rs index d7875c9c1724..6fa2f05107bc 100644 --- a/crates/store/re_types/src/components/translation3d.rs +++ b/crates/store/re_types/src/components/translation3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,22 +52,22 @@ impl ::re_types_core::Loggable for Translation3D { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Vec3D::from_arrow2_opt(arrow_data) + crate::datatypes::Vec3D::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Vec3D::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Vec3D::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/triangle_indices.rs b/crates/store/re_types/src/components/triangle_indices.rs index 1fb197e8c6c0..f141fd191a48 100644 --- a/crates/store/re_types/src/components/triangle_indices.rs +++ b/crates/store/re_types/src/components/triangle_indices.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,22 +52,22 @@ impl ::re_types_core::Loggable for TriangleIndices { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::UVec3D::from_arrow2_opt(arrow_data) + crate::datatypes::UVec3D::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::UVec3D::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::UVec3D::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/value_range.rs b/crates/store/re_types/src/components/value_range.rs index 9bcd6f464a69..56749f715304 100644 --- a/crates/store/re_types/src/components/value_range.rs +++ b/crates/store/re_types/src/components/value_range.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,22 +52,22 @@ impl ::re_types_core::Loggable for ValueRange { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Range1D::from_arrow2_opt(arrow_data) + crate::datatypes::Range1D::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Range1D::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Range1D::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/vector2d.rs b/crates/store/re_types/src/components/vector2d.rs index cdefaf8cc172..1299f5f92995 100644 --- a/crates/store/re_types/src/components/vector2d.rs +++ b/crates/store/re_types/src/components/vector2d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,22 +52,22 @@ impl ::re_types_core::Loggable for Vector2D { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Vec2D::from_arrow2_opt(arrow_data) + crate::datatypes::Vec2D::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Vec2D::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Vec2D::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/vector3d.rs b/crates/store/re_types/src/components/vector3d.rs index be25aefef481..e12f584e3dd7 100644 --- a/crates/store/re_types/src/components/vector3d.rs +++ b/crates/store/re_types/src/components/vector3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,22 +52,22 @@ impl ::re_types_core::Loggable for Vector3D { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Vec3D::from_arrow2_opt(arrow_data) + crate::datatypes::Vec3D::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::Vec3D::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::Vec3D::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/components/video_timestamp.rs b/crates/store/re_types/src/components/video_timestamp.rs index 4cfdc64bf217..f8a44f78fe81 100644 --- a/crates/store/re_types/src/components/video_timestamp.rs +++ b/crates/store/re_types/src/components/video_timestamp.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -52,22 +52,22 @@ impl ::re_types_core::Loggable for VideoTimestamp { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::VideoTimestamp::from_arrow2_opt(arrow_data) + crate::datatypes::VideoTimestamp::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::VideoTimestamp::from_arrow2(arrow_data) + crate::datatypes::VideoTimestamp::from_arrow(arrow_data) .map(|v| v.into_iter().map(Self).collect()) } } diff --git a/crates/store/re_types/src/components/view_coordinates.rs b/crates/store/re_types/src/components/view_coordinates.rs index dd66f8d5f498..7be645aeaa31 100644 --- a/crates/store/re_types/src/components/view_coordinates.rs +++ b/crates/store/re_types/src/components/view_coordinates.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -72,22 +72,22 @@ impl ::re_types_core::Loggable for ViewCoordinates { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::ViewCoordinates::from_arrow2_opt(arrow_data) + crate::datatypes::ViewCoordinates::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { - crate::datatypes::ViewCoordinates::from_arrow2(arrow_data).map(bytemuck::cast_vec) + crate::datatypes::ViewCoordinates::from_arrow(arrow_data).map(bytemuck::cast_vec) } } diff --git a/crates/store/re_types/src/datatypes/angle.rs b/crates/store/re_types/src/datatypes/angle.rs index b74b624fb9f9..f3869f1e139d 100644 --- a/crates/store/re_types/src/datatypes/angle.rs +++ b/crates/store/re_types/src/datatypes/angle.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -71,16 +71,15 @@ impl ::re_types_core::Loggable for Angle { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -91,7 +90,6 @@ impl ::re_types_core::Loggable for Angle { }) .with_context("rerun.datatypes.Angle#radians")? .into_iter() - .map(|opt| opt.copied()) .map(|v| v.ok_or_else(DeserializationError::missing_data)) .map(|res| res.map(|radians| Some(Self { radians }))) .collect::>>>() @@ -100,16 +98,15 @@ impl ::re_types_core::Loggable for Angle { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -124,7 +121,7 @@ impl ::re_types_core::Loggable for Angle { }) .with_context("rerun.datatypes.Angle#radians")? .values() - .as_slice(); + .as_ref(); { slice .iter() diff --git a/crates/store/re_types/src/datatypes/annotation_info.rs b/crates/store/re_types/src/datatypes/annotation_info.rs index 2c40d6bf2938..ec3122380c70 100644 --- a/crates/store/re_types/src/datatypes/annotation_info.rs +++ b/crates/store/re_types/src/datatypes/annotation_info.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -158,20 +158,19 @@ impl ::re_types_core::Loggable for AnnotationInfo { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -182,10 +181,10 @@ impl ::re_types_core::Loggable for AnnotationInfo { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let id = { @@ -207,7 +206,6 @@ impl ::re_types_core::Loggable for AnnotationInfo { }) .with_context("rerun.datatypes.AnnotationInfo#id")? .into_iter() - .map(|opt| opt.copied()) }; let label = { if !arrays_by_name.contains_key("label") { @@ -221,7 +219,7 @@ impl ::re_types_core::Loggable for AnnotationInfo { { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::Utf8; let actual = arrow_data.data_type().clone(); @@ -230,39 +228,37 @@ impl ::re_types_core::Loggable for AnnotationInfo { .with_context("rerun.datatypes.AnnotationInfo#label")?; let arrow_data_buf = arrow_data.values(); let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - let len = end - start; - if arrow_data_buf.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_buf.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + let len = end - start; + if arrow_data_buf.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_buf.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = - unsafe { arrow_data_buf.clone().sliced_unchecked(start, len) }; - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = arrow_data_buf.slice_with_length(start, len); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| { - res_or_opt.map(|v| { - crate::datatypes::Utf8(::re_types_core::ArrowString::from(v)) + .map(|res_or_opt| { + res_or_opt.map(|res_or_opt| { + res_or_opt.map(|v| { + crate::datatypes::Utf8(::re_types_core::ArrowString::from( + v, + )) + }) }) }) - }) - .collect::>>>() - .with_context("rerun.datatypes.AnnotationInfo#label")? - .into_iter() + .collect::>>>() + .with_context("rerun.datatypes.AnnotationInfo#label")? + .into_iter() } }; let color = { @@ -284,12 +280,11 @@ impl ::re_types_core::Loggable for AnnotationInfo { }) .with_context("rerun.datatypes.AnnotationInfo#color")? .into_iter() - .map(|opt| opt.copied()) .map(|res_or_opt| res_or_opt.map(crate::datatypes::Rgba32)) }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( ::itertools::izip!(id, label, color), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|opt| { opt.map(|(id, label, color)| { diff --git a/crates/store/re_types/src/datatypes/blob.rs b/crates/store/re_types/src/datatypes/blob.rs index 06e08627da94..f539ba97a02c 100644 --- a/crates/store/re_types/src/datatypes/blob.rs +++ b/crates/store/re_types/src/datatypes/blob.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -89,20 +89,19 @@ impl ::re_types_core::Loggable for Blob { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -126,33 +125,26 @@ impl ::re_types_core::Loggable for Blob { .values() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { - arrow_data_inner - .clone() - .sliced_unchecked(start, end - start) - }; - let data = ::re_types_core::ArrowBuffer::from(data); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = arrow_data_inner.clone().slice(start, end - start); + let data = ::re_types_core::ArrowBuffer::from(data); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } diff --git a/crates/store/re_types/src/datatypes/channel_datatype.rs b/crates/store/re_types/src/datatypes/channel_datatype.rs index 0dc6a7829caf..58106dfb8f8a 100644 --- a/crates/store/re_types/src/datatypes/channel_datatype.rs +++ b/crates/store/re_types/src/datatypes/channel_datatype.rs @@ -13,7 +13,7 @@ #![allow(clippy::too_many_lines)] #![allow(non_camel_case_types)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -105,16 +105,15 @@ impl ::re_types_core::Loggable for ChannelDatatype { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -125,7 +124,6 @@ impl ::re_types_core::Loggable for ChannelDatatype { }) .with_context("rerun.datatypes.ChannelDatatype#enum")? .into_iter() - .map(|opt| opt.copied()) .map(|typ| match typ { Some(6) => Ok(Some(Self::U8)), Some(7) => Ok(Some(Self::I8)), diff --git a/crates/store/re_types/src/datatypes/class_description.rs b/crates/store/re_types/src/datatypes/class_description.rs index b6827410d9b8..13ca4e5d524f 100644 --- a/crates/store/re_types/src/datatypes/class_description.rs +++ b/crates/store/re_types/src/datatypes/class_description.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -241,20 +241,19 @@ impl ::re_types_core::Loggable for ClassDescription { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -265,10 +264,10 @@ impl ::re_types_core::Loggable for ClassDescription { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let info = { @@ -280,7 +279,7 @@ impl ::re_types_core::Loggable for ClassDescription { .with_context("rerun.datatypes.ClassDescription"); } let arrow_data = &**arrays_by_name["info"]; - crate::datatypes::AnnotationInfo::from_arrow2_opt(arrow_data) + crate::datatypes::AnnotationInfo::from_arrow_opt(arrow_data) .with_context("rerun.datatypes.ClassDescription#info")? .into_iter() }; @@ -296,7 +295,7 @@ impl ::re_types_core::Loggable for ClassDescription { { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", @@ -314,7 +313,7 @@ impl ::re_types_core::Loggable for ClassDescription { } else { let arrow_data_inner = { let arrow_data_inner = &**arrow_data.values(); - crate::datatypes::AnnotationInfo::from_arrow2_opt(arrow_data_inner) + crate::datatypes::AnnotationInfo::from_arrow_opt(arrow_data_inner) .with_context( "rerun.datatypes.ClassDescription#keypoint_annotations", )? @@ -322,34 +321,31 @@ impl ::re_types_core::Loggable for ClassDescription { .collect::>() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = - unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data - .iter() - .cloned() - .map(Option::unwrap_or_default) - .collect(); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data + .iter() + .cloned() + .map(Option::unwrap_or_default) + .collect(); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } @@ -366,7 +362,7 @@ impl ::re_types_core::Loggable for ClassDescription { { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", @@ -384,7 +380,7 @@ impl ::re_types_core::Loggable for ClassDescription { } else { let arrow_data_inner = { let arrow_data_inner = &**arrow_data.values(); - crate::datatypes::KeypointPair::from_arrow2_opt(arrow_data_inner) + crate::datatypes::KeypointPair::from_arrow_opt(arrow_data_inner) .with_context( "rerun.datatypes.ClassDescription#keypoint_connections", )? @@ -392,41 +388,38 @@ impl ::re_types_core::Loggable for ClassDescription { .collect::>() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = - unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data - .iter() - .cloned() - .map(Option::unwrap_or_default) - .collect(); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data + .iter() + .cloned() + .map(Option::unwrap_or_default) + .collect(); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( ::itertools::izip!(info, keypoint_annotations, keypoint_connections), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|opt| { opt.map(|(info, keypoint_annotations, keypoint_connections)| { diff --git a/crates/store/re_types/src/datatypes/class_description_map_elem.rs b/crates/store/re_types/src/datatypes/class_description_map_elem.rs index 075f3b22301f..cec4a5199314 100644 --- a/crates/store/re_types/src/datatypes/class_description_map_elem.rs +++ b/crates/store/re_types/src/datatypes/class_description_map_elem.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -134,20 +134,19 @@ impl ::re_types_core::Loggable for ClassDescriptionMapElem { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -158,10 +157,10 @@ impl ::re_types_core::Loggable for ClassDescriptionMapElem { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let class_id = { @@ -183,7 +182,6 @@ impl ::re_types_core::Loggable for ClassDescriptionMapElem { }) .with_context("rerun.datatypes.ClassDescriptionMapElem#class_id")? .into_iter() - .map(|opt| opt.copied()) .map(|res_or_opt| res_or_opt.map(crate::datatypes::ClassId)) }; let class_description = { @@ -195,13 +193,13 @@ impl ::re_types_core::Loggable for ClassDescriptionMapElem { .with_context("rerun.datatypes.ClassDescriptionMapElem"); } let arrow_data = &**arrays_by_name["class_description"]; - crate::datatypes::ClassDescription::from_arrow2_opt(arrow_data) + crate::datatypes::ClassDescription::from_arrow_opt(arrow_data) .with_context("rerun.datatypes.ClassDescriptionMapElem#class_description")? .into_iter() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( ::itertools::izip!(class_id, class_description), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|opt| { opt.map(|(class_id, class_description)| { diff --git a/crates/store/re_types/src/datatypes/class_id.rs b/crates/store/re_types/src/datatypes/class_id.rs index 304ace03f214..bc0e2f531a2a 100644 --- a/crates/store/re_types/src/datatypes/class_id.rs +++ b/crates/store/re_types/src/datatypes/class_id.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -83,16 +83,15 @@ impl ::re_types_core::Loggable for ClassId { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -103,7 +102,6 @@ impl ::re_types_core::Loggable for ClassId { }) .with_context("rerun.datatypes.ClassId#id")? .into_iter() - .map(|opt| opt.copied()) .map(|v| v.ok_or_else(DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) .collect::>>>() @@ -112,16 +110,15 @@ impl ::re_types_core::Loggable for ClassId { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -136,7 +133,7 @@ impl ::re_types_core::Loggable for ClassId { }) .with_context("rerun.datatypes.ClassId#id")? .values() - .as_slice(); + .as_ref(); { slice.iter().copied().map(Self).collect::>() } diff --git a/crates/store/re_types/src/datatypes/color_model.rs b/crates/store/re_types/src/datatypes/color_model.rs index d7d6414e32da..4d621c7ed923 100644 --- a/crates/store/re_types/src/datatypes/color_model.rs +++ b/crates/store/re_types/src/datatypes/color_model.rs @@ -13,7 +13,7 @@ #![allow(clippy::too_many_lines)] #![allow(non_camel_case_types)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -91,16 +91,15 @@ impl ::re_types_core::Loggable for ColorModel { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -111,7 +110,6 @@ impl ::re_types_core::Loggable for ColorModel { }) .with_context("rerun.datatypes.ColorModel#enum")? .into_iter() - .map(|opt| opt.copied()) .map(|typ| match typ { Some(1) => Ok(Some(Self::L)), Some(2) => Ok(Some(Self::RGB)), diff --git a/crates/store/re_types/src/datatypes/dvec2d.rs b/crates/store/re_types/src/datatypes/dvec2d.rs index f5d8d0040a22..9d9f61c2b2a3 100644 --- a/crates/store/re_types/src/datatypes/dvec2d.rs +++ b/crates/store/re_types/src/datatypes/dvec2d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -91,20 +91,19 @@ impl ::re_types_core::Loggable for DVec2D { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -129,34 +128,30 @@ impl ::re_types_core::Loggable for DVec2D { }) .with_context("rerun.datatypes.DVec2D#xy")? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets, - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|(start, end): (usize, usize)| { - debug_assert!(end - start == 2usize); - if end > arrow_data_inner.len() { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets, arrow_data.nulls()) + .map(|elem| { + elem.map(|(start, end): (usize, usize)| { + debug_assert!(end - start == 2usize); + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data.iter().cloned().map(Option::unwrap_or_default); + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data.iter().cloned().map(Option::unwrap_or_default); - // NOTE: Unwrapping cannot fail: the length must be correct. - #[allow(clippy::unwrap_used)] - Ok(array_init::from_iter(data).unwrap()) + // NOTE: Unwrapping cannot fail: the length must be correct. + #[allow(clippy::unwrap_used)] + Ok(array_init::from_iter(data).unwrap()) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } @@ -168,16 +163,15 @@ impl ::re_types_core::Loggable for DVec2D { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -185,7 +179,7 @@ impl ::re_types_core::Loggable for DVec2D { let slice = { let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::FixedSizeList( std::sync::Arc::new(Field::new("item", DataType::Float64, false)), @@ -207,7 +201,7 @@ impl ::re_types_core::Loggable for DVec2D { }) .with_context("rerun.datatypes.DVec2D#xy")? .values() - .as_slice(), + .as_ref(), ) }; { diff --git a/crates/store/re_types/src/datatypes/image_format.rs b/crates/store/re_types/src/datatypes/image_format.rs index 1ca28125ab11..bde509ba0e80 100644 --- a/crates/store/re_types/src/datatypes/image_format.rs +++ b/crates/store/re_types/src/datatypes/image_format.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -225,20 +225,19 @@ impl ::re_types_core::Loggable for ImageFormat { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -249,10 +248,10 @@ impl ::re_types_core::Loggable for ImageFormat { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let width = { @@ -274,7 +273,6 @@ impl ::re_types_core::Loggable for ImageFormat { }) .with_context("rerun.datatypes.ImageFormat#width")? .into_iter() - .map(|opt| opt.copied()) }; let height = { if !arrays_by_name.contains_key("height") { @@ -295,7 +293,6 @@ impl ::re_types_core::Loggable for ImageFormat { }) .with_context("rerun.datatypes.ImageFormat#height")? .into_iter() - .map(|opt| opt.copied()) }; let pixel_format = { if !arrays_by_name.contains_key("pixel_format") { @@ -306,7 +303,7 @@ impl ::re_types_core::Loggable for ImageFormat { .with_context("rerun.datatypes.ImageFormat"); } let arrow_data = &**arrays_by_name["pixel_format"]; - crate::datatypes::PixelFormat::from_arrow2_opt(arrow_data) + crate::datatypes::PixelFormat::from_arrow_opt(arrow_data) .with_context("rerun.datatypes.ImageFormat#pixel_format")? .into_iter() }; @@ -319,7 +316,7 @@ impl ::re_types_core::Loggable for ImageFormat { .with_context("rerun.datatypes.ImageFormat"); } let arrow_data = &**arrays_by_name["color_model"]; - crate::datatypes::ColorModel::from_arrow2_opt(arrow_data) + crate::datatypes::ColorModel::from_arrow_opt(arrow_data) .with_context("rerun.datatypes.ImageFormat#color_model")? .into_iter() }; @@ -332,13 +329,13 @@ impl ::re_types_core::Loggable for ImageFormat { .with_context("rerun.datatypes.ImageFormat"); } let arrow_data = &**arrays_by_name["channel_datatype"]; - crate::datatypes::ChannelDatatype::from_arrow2_opt(arrow_data) + crate::datatypes::ChannelDatatype::from_arrow_opt(arrow_data) .with_context("rerun.datatypes.ImageFormat#channel_datatype")? .into_iter() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( ::itertools::izip!(width, height, pixel_format, color_model, channel_datatype), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|opt| { opt.map( diff --git a/crates/store/re_types/src/datatypes/keypoint_id.rs b/crates/store/re_types/src/datatypes/keypoint_id.rs index 9923b7950756..799a91851181 100644 --- a/crates/store/re_types/src/datatypes/keypoint_id.rs +++ b/crates/store/re_types/src/datatypes/keypoint_id.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -85,16 +85,15 @@ impl ::re_types_core::Loggable for KeypointId { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -105,7 +104,6 @@ impl ::re_types_core::Loggable for KeypointId { }) .with_context("rerun.datatypes.KeypointId#id")? .into_iter() - .map(|opt| opt.copied()) .map(|v| v.ok_or_else(DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) .collect::>>>() @@ -114,16 +112,15 @@ impl ::re_types_core::Loggable for KeypointId { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -138,7 +135,7 @@ impl ::re_types_core::Loggable for KeypointId { }) .with_context("rerun.datatypes.KeypointId#id")? .values() - .as_slice(); + .as_ref(); { slice.iter().copied().map(Self).collect::>() } diff --git a/crates/store/re_types/src/datatypes/keypoint_pair.rs b/crates/store/re_types/src/datatypes/keypoint_pair.rs index d487773cfe2b..d944e6468496 100644 --- a/crates/store/re_types/src/datatypes/keypoint_pair.rs +++ b/crates/store/re_types/src/datatypes/keypoint_pair.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -136,20 +136,19 @@ impl ::re_types_core::Loggable for KeypointPair { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -160,10 +159,10 @@ impl ::re_types_core::Loggable for KeypointPair { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let keypoint0 = { @@ -185,7 +184,6 @@ impl ::re_types_core::Loggable for KeypointPair { }) .with_context("rerun.datatypes.KeypointPair#keypoint0")? .into_iter() - .map(|opt| opt.copied()) .map(|res_or_opt| res_or_opt.map(crate::datatypes::KeypointId)) }; let keypoint1 = { @@ -207,12 +205,11 @@ impl ::re_types_core::Loggable for KeypointPair { }) .with_context("rerun.datatypes.KeypointPair#keypoint1")? .into_iter() - .map(|opt| opt.copied()) .map(|res_or_opt| res_or_opt.map(crate::datatypes::KeypointId)) }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( ::itertools::izip!(keypoint0, keypoint1), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|opt| { opt.map(|(keypoint0, keypoint1)| { diff --git a/crates/store/re_types/src/datatypes/mat3x3.rs b/crates/store/re_types/src/datatypes/mat3x3.rs index 920ad38a6f7d..36e4d8bc841d 100644 --- a/crates/store/re_types/src/datatypes/mat3x3.rs +++ b/crates/store/re_types/src/datatypes/mat3x3.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -103,20 +103,19 @@ impl ::re_types_core::Loggable for Mat3x3 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -141,34 +140,30 @@ impl ::re_types_core::Loggable for Mat3x3 { }) .with_context("rerun.datatypes.Mat3x3#flat_columns")? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets, - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|(start, end): (usize, usize)| { - debug_assert!(end - start == 9usize); - if end > arrow_data_inner.len() { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets, arrow_data.nulls()) + .map(|elem| { + elem.map(|(start, end): (usize, usize)| { + debug_assert!(end - start == 9usize); + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data.iter().cloned().map(Option::unwrap_or_default); + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data.iter().cloned().map(Option::unwrap_or_default); - // NOTE: Unwrapping cannot fail: the length must be correct. - #[allow(clippy::unwrap_used)] - Ok(array_init::from_iter(data).unwrap()) + // NOTE: Unwrapping cannot fail: the length must be correct. + #[allow(clippy::unwrap_used)] + Ok(array_init::from_iter(data).unwrap()) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } @@ -180,16 +175,15 @@ impl ::re_types_core::Loggable for Mat3x3 { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -197,7 +191,7 @@ impl ::re_types_core::Loggable for Mat3x3 { let slice = { let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::FixedSizeList( std::sync::Arc::new(Field::new("item", DataType::Float32, false)), @@ -219,7 +213,7 @@ impl ::re_types_core::Loggable for Mat3x3 { }) .with_context("rerun.datatypes.Mat3x3#flat_columns")? .values() - .as_slice(), + .as_ref(), ) }; { diff --git a/crates/store/re_types/src/datatypes/mat4x4.rs b/crates/store/re_types/src/datatypes/mat4x4.rs index 45da55ee1117..d085779f8284 100644 --- a/crates/store/re_types/src/datatypes/mat4x4.rs +++ b/crates/store/re_types/src/datatypes/mat4x4.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -103,20 +103,19 @@ impl ::re_types_core::Loggable for Mat4x4 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -141,34 +140,30 @@ impl ::re_types_core::Loggable for Mat4x4 { }) .with_context("rerun.datatypes.Mat4x4#flat_columns")? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets, - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|(start, end): (usize, usize)| { - debug_assert!(end - start == 16usize); - if end > arrow_data_inner.len() { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets, arrow_data.nulls()) + .map(|elem| { + elem.map(|(start, end): (usize, usize)| { + debug_assert!(end - start == 16usize); + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data.iter().cloned().map(Option::unwrap_or_default); + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data.iter().cloned().map(Option::unwrap_or_default); - // NOTE: Unwrapping cannot fail: the length must be correct. - #[allow(clippy::unwrap_used)] - Ok(array_init::from_iter(data).unwrap()) + // NOTE: Unwrapping cannot fail: the length must be correct. + #[allow(clippy::unwrap_used)] + Ok(array_init::from_iter(data).unwrap()) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } @@ -180,16 +175,15 @@ impl ::re_types_core::Loggable for Mat4x4 { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -197,7 +191,7 @@ impl ::re_types_core::Loggable for Mat4x4 { let slice = { let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::FixedSizeList( std::sync::Arc::new(Field::new("item", DataType::Float32, false)), @@ -219,7 +213,7 @@ impl ::re_types_core::Loggable for Mat4x4 { }) .with_context("rerun.datatypes.Mat4x4#flat_columns")? .values() - .as_slice(), + .as_ref(), ) }; { diff --git a/crates/store/re_types/src/datatypes/pixel_format.rs b/crates/store/re_types/src/datatypes/pixel_format.rs index 0b7c9aa8301e..3d956c1afb75 100644 --- a/crates/store/re_types/src/datatypes/pixel_format.rs +++ b/crates/store/re_types/src/datatypes/pixel_format.rs @@ -13,7 +13,7 @@ #![allow(clippy::too_many_lines)] #![allow(non_camel_case_types)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -170,16 +170,15 @@ impl ::re_types_core::Loggable for PixelFormat { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -190,7 +189,6 @@ impl ::re_types_core::Loggable for PixelFormat { }) .with_context("rerun.datatypes.PixelFormat#enum")? .into_iter() - .map(|opt| opt.copied()) .map(|typ| match typ { Some(20) => Ok(Some(Self::Y_U_V12_LimitedRange)), Some(26) => Ok(Some(Self::NV12)), diff --git a/crates/store/re_types/src/datatypes/plane3d.rs b/crates/store/re_types/src/datatypes/plane3d.rs index 7607453c2349..989d0002475d 100644 --- a/crates/store/re_types/src/datatypes/plane3d.rs +++ b/crates/store/re_types/src/datatypes/plane3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -99,20 +99,19 @@ impl ::re_types_core::Loggable for Plane3D { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -137,34 +136,30 @@ impl ::re_types_core::Loggable for Plane3D { }) .with_context("rerun.datatypes.Plane3D#xyzd")? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets, - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|(start, end): (usize, usize)| { - debug_assert!(end - start == 4usize); - if end > arrow_data_inner.len() { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets, arrow_data.nulls()) + .map(|elem| { + elem.map(|(start, end): (usize, usize)| { + debug_assert!(end - start == 4usize); + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data.iter().cloned().map(Option::unwrap_or_default); + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data.iter().cloned().map(Option::unwrap_or_default); - // NOTE: Unwrapping cannot fail: the length must be correct. - #[allow(clippy::unwrap_used)] - Ok(array_init::from_iter(data).unwrap()) + // NOTE: Unwrapping cannot fail: the length must be correct. + #[allow(clippy::unwrap_used)] + Ok(array_init::from_iter(data).unwrap()) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } @@ -176,16 +171,15 @@ impl ::re_types_core::Loggable for Plane3D { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -193,7 +187,7 @@ impl ::re_types_core::Loggable for Plane3D { let slice = { let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::FixedSizeList( std::sync::Arc::new(Field::new("item", DataType::Float32, false)), @@ -215,7 +209,7 @@ impl ::re_types_core::Loggable for Plane3D { }) .with_context("rerun.datatypes.Plane3D#xyzd")? .values() - .as_slice(), + .as_ref(), ) }; { diff --git a/crates/store/re_types/src/datatypes/quaternion.rs b/crates/store/re_types/src/datatypes/quaternion.rs index dde74d4cd6d8..50e739e26676 100644 --- a/crates/store/re_types/src/datatypes/quaternion.rs +++ b/crates/store/re_types/src/datatypes/quaternion.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -94,20 +94,19 @@ impl ::re_types_core::Loggable for Quaternion { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -132,34 +131,30 @@ impl ::re_types_core::Loggable for Quaternion { }) .with_context("rerun.datatypes.Quaternion#xyzw")? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets, - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|(start, end): (usize, usize)| { - debug_assert!(end - start == 4usize); - if end > arrow_data_inner.len() { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets, arrow_data.nulls()) + .map(|elem| { + elem.map(|(start, end): (usize, usize)| { + debug_assert!(end - start == 4usize); + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data.iter().cloned().map(Option::unwrap_or_default); + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data.iter().cloned().map(Option::unwrap_or_default); - // NOTE: Unwrapping cannot fail: the length must be correct. - #[allow(clippy::unwrap_used)] - Ok(array_init::from_iter(data).unwrap()) + // NOTE: Unwrapping cannot fail: the length must be correct. + #[allow(clippy::unwrap_used)] + Ok(array_init::from_iter(data).unwrap()) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } @@ -171,16 +166,15 @@ impl ::re_types_core::Loggable for Quaternion { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -188,7 +182,7 @@ impl ::re_types_core::Loggable for Quaternion { let slice = { let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::FixedSizeList( std::sync::Arc::new(Field::new("item", DataType::Float32, false)), @@ -210,7 +204,7 @@ impl ::re_types_core::Loggable for Quaternion { }) .with_context("rerun.datatypes.Quaternion#xyzw")? .values() - .as_slice(), + .as_ref(), ) }; { diff --git a/crates/store/re_types/src/datatypes/range1d.rs b/crates/store/re_types/src/datatypes/range1d.rs index 991fa76b5501..72146f7c924c 100644 --- a/crates/store/re_types/src/datatypes/range1d.rs +++ b/crates/store/re_types/src/datatypes/range1d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -91,20 +91,19 @@ impl ::re_types_core::Loggable for Range1D { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -129,34 +128,30 @@ impl ::re_types_core::Loggable for Range1D { }) .with_context("rerun.datatypes.Range1D#range")? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets, - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|(start, end): (usize, usize)| { - debug_assert!(end - start == 2usize); - if end > arrow_data_inner.len() { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets, arrow_data.nulls()) + .map(|elem| { + elem.map(|(start, end): (usize, usize)| { + debug_assert!(end - start == 2usize); + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data.iter().cloned().map(Option::unwrap_or_default); + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data.iter().cloned().map(Option::unwrap_or_default); - // NOTE: Unwrapping cannot fail: the length must be correct. - #[allow(clippy::unwrap_used)] - Ok(array_init::from_iter(data).unwrap()) + // NOTE: Unwrapping cannot fail: the length must be correct. + #[allow(clippy::unwrap_used)] + Ok(array_init::from_iter(data).unwrap()) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } @@ -168,16 +163,15 @@ impl ::re_types_core::Loggable for Range1D { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -185,7 +179,7 @@ impl ::re_types_core::Loggable for Range1D { let slice = { let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::FixedSizeList( std::sync::Arc::new(Field::new("item", DataType::Float64, false)), @@ -207,7 +201,7 @@ impl ::re_types_core::Loggable for Range1D { }) .with_context("rerun.datatypes.Range1D#range")? .values() - .as_slice(), + .as_ref(), ) }; { diff --git a/crates/store/re_types/src/datatypes/range2d.rs b/crates/store/re_types/src/datatypes/range2d.rs index 5451895c339b..968301ba49c5 100644 --- a/crates/store/re_types/src/datatypes/range2d.rs +++ b/crates/store/re_types/src/datatypes/range2d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -173,20 +173,19 @@ impl ::re_types_core::Loggable for Range2D { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -197,10 +196,10 @@ impl ::re_types_core::Loggable for Range2D { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let x_range = { @@ -215,7 +214,7 @@ impl ::re_types_core::Loggable for Range2D { { let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::FixedSizeList( std::sync::Arc::new(Field::new( @@ -247,39 +246,36 @@ impl ::re_types_core::Loggable for Range2D { }) .with_context("rerun.datatypes.Range2D#x_range")? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets, - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|(start, end): (usize, usize)| { - debug_assert!(end - start == 2usize); - if end > arrow_data_inner.len() { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets, arrow_data.nulls()) + .map(|elem| { + elem.map(|(start, end): (usize, usize)| { + debug_assert!(end - start == 2usize); + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = - unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data.iter().cloned().map(Option::unwrap_or_default); + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = + data.iter().cloned().map(Option::unwrap_or_default); - // NOTE: Unwrapping cannot fail: the length must be correct. - #[allow(clippy::unwrap_used)] - Ok(array_init::from_iter(data).unwrap()) + // NOTE: Unwrapping cannot fail: the length must be correct. + #[allow(clippy::unwrap_used)] + Ok(array_init::from_iter(data).unwrap()) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt - .map(|res_or_opt| res_or_opt.map(crate::datatypes::Range1D)) - }) - .collect::>>>()? + .map(|res_or_opt| { + res_or_opt + .map(|res_or_opt| res_or_opt.map(crate::datatypes::Range1D)) + }) + .collect::>>>()? } .into_iter() } @@ -296,7 +292,7 @@ impl ::re_types_core::Loggable for Range2D { { let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::FixedSizeList( std::sync::Arc::new(Field::new( @@ -328,46 +324,43 @@ impl ::re_types_core::Loggable for Range2D { }) .with_context("rerun.datatypes.Range2D#y_range")? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets, - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|(start, end): (usize, usize)| { - debug_assert!(end - start == 2usize); - if end > arrow_data_inner.len() { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets, arrow_data.nulls()) + .map(|elem| { + elem.map(|(start, end): (usize, usize)| { + debug_assert!(end - start == 2usize); + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = - unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data.iter().cloned().map(Option::unwrap_or_default); + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = + data.iter().cloned().map(Option::unwrap_or_default); - // NOTE: Unwrapping cannot fail: the length must be correct. - #[allow(clippy::unwrap_used)] - Ok(array_init::from_iter(data).unwrap()) + // NOTE: Unwrapping cannot fail: the length must be correct. + #[allow(clippy::unwrap_used)] + Ok(array_init::from_iter(data).unwrap()) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt - .map(|res_or_opt| res_or_opt.map(crate::datatypes::Range1D)) - }) - .collect::>>>()? + .map(|res_or_opt| { + res_or_opt + .map(|res_or_opt| res_or_opt.map(crate::datatypes::Range1D)) + }) + .collect::>>>()? } .into_iter() } }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( ::itertools::izip!(x_range, y_range), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|opt| { opt.map(|(x_range, y_range)| { diff --git a/crates/store/re_types/src/datatypes/rgba32.rs b/crates/store/re_types/src/datatypes/rgba32.rs index 8fb26c31b5b6..945c3deab7ab 100644 --- a/crates/store/re_types/src/datatypes/rgba32.rs +++ b/crates/store/re_types/src/datatypes/rgba32.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -73,16 +73,15 @@ impl ::re_types_core::Loggable for Rgba32 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -93,7 +92,6 @@ impl ::re_types_core::Loggable for Rgba32 { }) .with_context("rerun.datatypes.Rgba32#rgba")? .into_iter() - .map(|opt| opt.copied()) .map(|v| v.ok_or_else(DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) .collect::>>>() @@ -102,16 +100,15 @@ impl ::re_types_core::Loggable for Rgba32 { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -126,7 +123,7 @@ impl ::re_types_core::Loggable for Rgba32 { }) .with_context("rerun.datatypes.Rgba32#rgba")? .values() - .as_slice(); + .as_ref(); { slice.iter().copied().map(Self).collect::>() } diff --git a/crates/store/re_types/src/datatypes/rotation_axis_angle.rs b/crates/store/re_types/src/datatypes/rotation_axis_angle.rs index 59218e9ced58..9a43e87ec66e 100644 --- a/crates/store/re_types/src/datatypes/rotation_axis_angle.rs +++ b/crates/store/re_types/src/datatypes/rotation_axis_angle.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -144,20 +144,19 @@ impl ::re_types_core::Loggable for RotationAxisAngle { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -168,10 +167,10 @@ impl ::re_types_core::Loggable for RotationAxisAngle { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let axis = { @@ -186,7 +185,7 @@ impl ::re_types_core::Loggable for RotationAxisAngle { { let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::FixedSizeList( std::sync::Arc::new(Field::new( @@ -218,38 +217,36 @@ impl ::re_types_core::Loggable for RotationAxisAngle { }) .with_context("rerun.datatypes.RotationAxisAngle#axis")? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets, - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|(start, end): (usize, usize)| { - debug_assert!(end - start == 3usize); - if end > arrow_data_inner.len() { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets, arrow_data.nulls()) + .map(|elem| { + elem.map(|(start, end): (usize, usize)| { + debug_assert!(end - start == 3usize); + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = - unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data.iter().cloned().map(Option::unwrap_or_default); + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = + data.iter().cloned().map(Option::unwrap_or_default); - // NOTE: Unwrapping cannot fail: the length must be correct. - #[allow(clippy::unwrap_used)] - Ok(array_init::from_iter(data).unwrap()) + // NOTE: Unwrapping cannot fail: the length must be correct. + #[allow(clippy::unwrap_used)] + Ok(array_init::from_iter(data).unwrap()) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| res_or_opt.map(crate::datatypes::Vec3D)) - }) - .collect::>>>()? + .map(|res_or_opt| { + res_or_opt + .map(|res_or_opt| res_or_opt.map(crate::datatypes::Vec3D)) + }) + .collect::>>>()? } .into_iter() } @@ -273,30 +270,26 @@ impl ::re_types_core::Loggable for RotationAxisAngle { }) .with_context("rerun.datatypes.RotationAxisAngle#angle")? .into_iter() - .map(|opt| opt.copied()) .map(|res_or_opt| { res_or_opt.map(|radians| crate::datatypes::Angle { radians }) }) }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - ::itertools::izip!(axis, angle), - arrow_data.validity(), - ) - .map(|opt| { - opt.map(|(axis, angle)| { - Ok(Self { - axis: axis - .ok_or_else(DeserializationError::missing_data) - .with_context("rerun.datatypes.RotationAxisAngle#axis")?, - angle: angle - .ok_or_else(DeserializationError::missing_data) - .with_context("rerun.datatypes.RotationAxisAngle#angle")?, + ZipValidity::new_with_validity(::itertools::izip!(axis, angle), arrow_data.nulls()) + .map(|opt| { + opt.map(|(axis, angle)| { + Ok(Self { + axis: axis + .ok_or_else(DeserializationError::missing_data) + .with_context("rerun.datatypes.RotationAxisAngle#axis")?, + angle: angle + .ok_or_else(DeserializationError::missing_data) + .with_context("rerun.datatypes.RotationAxisAngle#angle")?, + }) }) + .transpose() }) - .transpose() - }) - .collect::>>() - .with_context("rerun.datatypes.RotationAxisAngle")? + .collect::>>() + .with_context("rerun.datatypes.RotationAxisAngle")? } }) } diff --git a/crates/store/re_types/src/datatypes/tensor_buffer.rs b/crates/store/re_types/src/datatypes/tensor_buffer.rs index cf2df863a568..454032b310cf 100644 --- a/crates/store/re_types/src/datatypes/tensor_buffer.rs +++ b/crates/store/re_types/src/datatypes/tensor_buffer.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -746,20 +746,19 @@ impl ::re_types_core::Loggable for TensorBuffer { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -769,8 +768,7 @@ impl ::re_types_core::Loggable for TensorBuffer { if arrow_data.is_empty() { Vec::new() } else { - let (arrow_data_types, arrow_data_arrays) = - (arrow_data.types(), arrow_data.fields()); + let arrow_data_type_ids = arrow_data.type_ids(); let arrow_data_offsets = arrow_data .offsets() .ok_or_else(|| { @@ -779,22 +777,22 @@ impl ::re_types_core::Loggable for TensorBuffer { DeserializationError::datatype_mismatch(expected, actual) }) .with_context("rerun.datatypes.TensorBuffer")?; - if arrow_data_types.len() != arrow_data_offsets.len() { + if arrow_data_type_ids.len() != arrow_data_offsets.len() { return Err(DeserializationError::offset_slice_oob( - (0, arrow_data_types.len()), + (0, arrow_data_type_ids.len()), arrow_data_offsets.len(), )) .with_context("rerun.datatypes.TensorBuffer"); } let u8 = { - if arrow_data_arrays.len() <= 1 { + if arrow_data.type_ids().inner().len() <= 1 { return Ok(Vec::new()); } - let arrow_data = &*arrow_data_arrays[1]; + let arrow_data = arrow_data.child(1).as_ref(); { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", @@ -822,47 +820,41 @@ impl ::re_types_core::Loggable for TensorBuffer { .values() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { - arrow_data_inner - .clone() - .sliced_unchecked(start, end - start) - }; - let data = ::re_types_core::ArrowBuffer::from(data); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + arrow_data_inner.clone().slice(start, end - start); + let data = ::re_types_core::ArrowBuffer::from(data); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } .collect::>() }; let u16 = { - if arrow_data_arrays.len() <= 2 { + if arrow_data.type_ids().inner().len() <= 2 { return Ok(Vec::new()); } - let arrow_data = &*arrow_data_arrays[2]; + let arrow_data = arrow_data.child(2).as_ref(); { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", @@ -890,47 +882,41 @@ impl ::re_types_core::Loggable for TensorBuffer { .values() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { - arrow_data_inner - .clone() - .sliced_unchecked(start, end - start) - }; - let data = ::re_types_core::ArrowBuffer::from(data); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + arrow_data_inner.clone().slice(start, end - start); + let data = ::re_types_core::ArrowBuffer::from(data); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } .collect::>() }; let u32 = { - if arrow_data_arrays.len() <= 3 { + if arrow_data.type_ids().inner().len() <= 3 { return Ok(Vec::new()); } - let arrow_data = &*arrow_data_arrays[3]; + let arrow_data = arrow_data.child(3).as_ref(); { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", @@ -958,47 +944,41 @@ impl ::re_types_core::Loggable for TensorBuffer { .values() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { - arrow_data_inner - .clone() - .sliced_unchecked(start, end - start) - }; - let data = ::re_types_core::ArrowBuffer::from(data); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + arrow_data_inner.clone().slice(start, end - start); + let data = ::re_types_core::ArrowBuffer::from(data); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } .collect::>() }; let u64 = { - if arrow_data_arrays.len() <= 4 { + if arrow_data.type_ids().inner().len() <= 4 { return Ok(Vec::new()); } - let arrow_data = &*arrow_data_arrays[4]; + let arrow_data = arrow_data.child(4).as_ref(); { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", @@ -1026,47 +1006,41 @@ impl ::re_types_core::Loggable for TensorBuffer { .values() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { - arrow_data_inner - .clone() - .sliced_unchecked(start, end - start) - }; - let data = ::re_types_core::ArrowBuffer::from(data); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + arrow_data_inner.clone().slice(start, end - start); + let data = ::re_types_core::ArrowBuffer::from(data); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } .collect::>() }; let i8 = { - if arrow_data_arrays.len() <= 5 { + if arrow_data.type_ids().inner().len() <= 5 { return Ok(Vec::new()); } - let arrow_data = &*arrow_data_arrays[5]; + let arrow_data = arrow_data.child(5).as_ref(); { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", @@ -1094,47 +1068,41 @@ impl ::re_types_core::Loggable for TensorBuffer { .values() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { - arrow_data_inner - .clone() - .sliced_unchecked(start, end - start) - }; - let data = ::re_types_core::ArrowBuffer::from(data); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + arrow_data_inner.clone().slice(start, end - start); + let data = ::re_types_core::ArrowBuffer::from(data); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } .collect::>() }; let i16 = { - if arrow_data_arrays.len() <= 6 { + if arrow_data.type_ids().inner().len() <= 6 { return Ok(Vec::new()); } - let arrow_data = &*arrow_data_arrays[6]; + let arrow_data = arrow_data.child(6).as_ref(); { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", @@ -1162,47 +1130,41 @@ impl ::re_types_core::Loggable for TensorBuffer { .values() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { - arrow_data_inner - .clone() - .sliced_unchecked(start, end - start) - }; - let data = ::re_types_core::ArrowBuffer::from(data); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + arrow_data_inner.clone().slice(start, end - start); + let data = ::re_types_core::ArrowBuffer::from(data); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } .collect::>() }; let i32 = { - if arrow_data_arrays.len() <= 7 { + if arrow_data.type_ids().inner().len() <= 7 { return Ok(Vec::new()); } - let arrow_data = &*arrow_data_arrays[7]; + let arrow_data = arrow_data.child(7).as_ref(); { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", @@ -1230,47 +1192,41 @@ impl ::re_types_core::Loggable for TensorBuffer { .values() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { - arrow_data_inner - .clone() - .sliced_unchecked(start, end - start) - }; - let data = ::re_types_core::ArrowBuffer::from(data); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + arrow_data_inner.clone().slice(start, end - start); + let data = ::re_types_core::ArrowBuffer::from(data); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } .collect::>() }; let i64 = { - if arrow_data_arrays.len() <= 8 { + if arrow_data.type_ids().inner().len() <= 8 { return Ok(Vec::new()); } - let arrow_data = &*arrow_data_arrays[8]; + let arrow_data = arrow_data.child(8).as_ref(); { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", @@ -1298,47 +1254,41 @@ impl ::re_types_core::Loggable for TensorBuffer { .values() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { - arrow_data_inner - .clone() - .sliced_unchecked(start, end - start) - }; - let data = ::re_types_core::ArrowBuffer::from(data); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + arrow_data_inner.clone().slice(start, end - start); + let data = ::re_types_core::ArrowBuffer::from(data); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } .collect::>() }; let f16 = { - if arrow_data_arrays.len() <= 9 { + if arrow_data.type_ids().inner().len() <= 9 { return Ok(Vec::new()); } - let arrow_data = &*arrow_data_arrays[9]; + let arrow_data = arrow_data.child(9).as_ref(); { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", @@ -1366,47 +1316,41 @@ impl ::re_types_core::Loggable for TensorBuffer { .values() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { - arrow_data_inner - .clone() - .sliced_unchecked(start, end - start) - }; - let data = ::re_types_core::ArrowBuffer::from(data); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + arrow_data_inner.clone().slice(start, end - start); + let data = ::re_types_core::ArrowBuffer::from(data); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } .collect::>() }; let f32 = { - if arrow_data_arrays.len() <= 10 { + if arrow_data.type_ids().inner().len() <= 10 { return Ok(Vec::new()); } - let arrow_data = &*arrow_data_arrays[10]; + let arrow_data = arrow_data.child(10).as_ref(); { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", @@ -1434,47 +1378,41 @@ impl ::re_types_core::Loggable for TensorBuffer { .values() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { - arrow_data_inner - .clone() - .sliced_unchecked(start, end - start) - }; - let data = ::re_types_core::ArrowBuffer::from(data); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + arrow_data_inner.clone().slice(start, end - start); + let data = ::re_types_core::ArrowBuffer::from(data); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } .collect::>() }; let f64 = { - if arrow_data_arrays.len() <= 11 { + if arrow_data.type_ids().inner().len() <= 11 { return Ok(Vec::new()); } - let arrow_data = &*arrow_data_arrays[11]; + let arrow_data = arrow_data.child(11).as_ref(); { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", @@ -1502,39 +1440,33 @@ impl ::re_types_core::Loggable for TensorBuffer { .values() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { - arrow_data_inner - .clone() - .sliced_unchecked(start, end - start) - }; - let data = ::re_types_core::ArrowBuffer::from(data); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + arrow_data_inner.clone().slice(start, end - start); + let data = ::re_types_core::ArrowBuffer::from(data); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } .collect::>() }; - arrow_data_types + arrow_data_type_ids .iter() .enumerate() .map(|(i, typ)| { diff --git a/crates/store/re_types/src/datatypes/tensor_data.rs b/crates/store/re_types/src/datatypes/tensor_data.rs index 4d75cc0c12e3..a064c0bf5dfb 100644 --- a/crates/store/re_types/src/datatypes/tensor_data.rs +++ b/crates/store/re_types/src/datatypes/tensor_data.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -233,20 +233,19 @@ impl ::re_types_core::Loggable for TensorData { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -257,10 +256,10 @@ impl ::re_types_core::Loggable for TensorData { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let shape = { @@ -275,7 +274,7 @@ impl ::re_types_core::Loggable for TensorData { { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", @@ -303,33 +302,27 @@ impl ::re_types_core::Loggable for TensorData { .values() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { - arrow_data_inner - .clone() - .sliced_unchecked(start, end - start) - }; - let data = ::re_types_core::ArrowBuffer::from(data); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + arrow_data_inner.clone().slice(start, end - start); + let data = ::re_types_core::ArrowBuffer::from(data); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } @@ -346,7 +339,7 @@ impl ::re_types_core::Loggable for TensorData { { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", @@ -365,7 +358,7 @@ impl ::re_types_core::Loggable for TensorData { { let arrow_data_inner = arrow_data_inner .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::Utf8; let actual = arrow_data_inner.data_type().clone(); @@ -376,9 +369,9 @@ impl ::re_types_core::Loggable for TensorData { .with_context("rerun.datatypes.TensorData#names")?; let arrow_data_inner_buf = arrow_data_inner.values(); let offsets = arrow_data_inner.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( offsets.windows(2), - arrow_data_inner.validity(), + arrow_data_inner.nulls(), ) .map(|elem| { elem.map(|window| { @@ -398,11 +391,8 @@ impl ::re_types_core::Loggable for TensorData { unsafe_code, clippy::undocumented_unsafe_blocks )] - let data = unsafe { - arrow_data_inner_buf - .clone() - .sliced_unchecked(start, len) - }; + let data = + arrow_data_inner_buf.slice_with_length(start, len); Ok(data) }) .transpose() @@ -420,34 +410,31 @@ impl ::re_types_core::Loggable for TensorData { .collect::>() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = - unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data - .iter() - .cloned() - .map(Option::unwrap_or_default) - .collect(); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data + .iter() + .cloned() + .map(Option::unwrap_or_default) + .collect(); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } @@ -461,13 +448,13 @@ impl ::re_types_core::Loggable for TensorData { .with_context("rerun.datatypes.TensorData"); } let arrow_data = &**arrays_by_name["buffer"]; - crate::datatypes::TensorBuffer::from_arrow2_opt(arrow_data) + crate::datatypes::TensorBuffer::from_arrow_opt(arrow_data) .with_context("rerun.datatypes.TensorData#buffer")? .into_iter() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( ::itertools::izip!(shape, names, buffer), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|opt| { opt.map(|(shape, names, buffer)| { diff --git a/crates/store/re_types/src/datatypes/tensor_dimension_index_selection.rs b/crates/store/re_types/src/datatypes/tensor_dimension_index_selection.rs index 179947448fcb..0dc09505356f 100644 --- a/crates/store/re_types/src/datatypes/tensor_dimension_index_selection.rs +++ b/crates/store/re_types/src/datatypes/tensor_dimension_index_selection.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -122,20 +122,19 @@ impl ::re_types_core::Loggable for TensorDimensionIndexSelection { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -146,10 +145,10 @@ impl ::re_types_core::Loggable for TensorDimensionIndexSelection { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let dimension = { @@ -171,7 +170,6 @@ impl ::re_types_core::Loggable for TensorDimensionIndexSelection { }) .with_context("rerun.datatypes.TensorDimensionIndexSelection#dimension")? .into_iter() - .map(|opt| opt.copied()) }; let index = { if !arrays_by_name.contains_key("index") { @@ -192,11 +190,10 @@ impl ::re_types_core::Loggable for TensorDimensionIndexSelection { }) .with_context("rerun.datatypes.TensorDimensionIndexSelection#index")? .into_iter() - .map(|opt| opt.copied()) }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( ::itertools::izip!(dimension, index), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|opt| { opt.map(|(dimension, index)| { diff --git a/crates/store/re_types/src/datatypes/tensor_dimension_selection.rs b/crates/store/re_types/src/datatypes/tensor_dimension_selection.rs index cbf750d55342..5688961210a5 100644 --- a/crates/store/re_types/src/datatypes/tensor_dimension_selection.rs +++ b/crates/store/re_types/src/datatypes/tensor_dimension_selection.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -120,20 +120,19 @@ impl ::re_types_core::Loggable for TensorDimensionSelection { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -144,10 +143,10 @@ impl ::re_types_core::Loggable for TensorDimensionSelection { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let dimension = { @@ -169,7 +168,6 @@ impl ::re_types_core::Loggable for TensorDimensionSelection { }) .with_context("rerun.datatypes.TensorDimensionSelection#dimension")? .into_iter() - .map(|opt| opt.copied()) }; let invert = { if !arrays_by_name.contains_key("invert") { @@ -191,9 +189,9 @@ impl ::re_types_core::Loggable for TensorDimensionSelection { .with_context("rerun.datatypes.TensorDimensionSelection#invert")? .into_iter() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( ::itertools::izip!(dimension, invert), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|opt| { opt.map(|(dimension, invert)| { diff --git a/crates/store/re_types/src/datatypes/utf8pair.rs b/crates/store/re_types/src/datatypes/utf8pair.rs index 2eec236d7687..11ddfd9ee540 100644 --- a/crates/store/re_types/src/datatypes/utf8pair.rs +++ b/crates/store/re_types/src/datatypes/utf8pair.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -134,20 +134,19 @@ impl ::re_types_core::Loggable for Utf8Pair { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -158,10 +157,10 @@ impl ::re_types_core::Loggable for Utf8Pair { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let first = { @@ -176,7 +175,7 @@ impl ::re_types_core::Loggable for Utf8Pair { { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::Utf8; let actual = arrow_data.data_type().clone(); @@ -185,39 +184,37 @@ impl ::re_types_core::Loggable for Utf8Pair { .with_context("rerun.datatypes.Utf8Pair#first")?; let arrow_data_buf = arrow_data.values(); let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - let len = end - start; - if arrow_data_buf.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_buf.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + let len = end - start; + if arrow_data_buf.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_buf.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = - unsafe { arrow_data_buf.clone().sliced_unchecked(start, len) }; - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = arrow_data_buf.slice_with_length(start, len); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| { - res_or_opt.map(|v| { - crate::datatypes::Utf8(::re_types_core::ArrowString::from(v)) + .map(|res_or_opt| { + res_or_opt.map(|res_or_opt| { + res_or_opt.map(|v| { + crate::datatypes::Utf8(::re_types_core::ArrowString::from( + v, + )) + }) }) }) - }) - .collect::>>>() - .with_context("rerun.datatypes.Utf8Pair#first")? - .into_iter() + .collect::>>>() + .with_context("rerun.datatypes.Utf8Pair#first")? + .into_iter() } }; let second = { @@ -232,7 +229,7 @@ impl ::re_types_core::Loggable for Utf8Pair { { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::Utf8; let actual = arrow_data.data_type().clone(); @@ -241,44 +238,42 @@ impl ::re_types_core::Loggable for Utf8Pair { .with_context("rerun.datatypes.Utf8Pair#second")?; let arrow_data_buf = arrow_data.values(); let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - let len = end - start; - if arrow_data_buf.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_buf.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + let len = end - start; + if arrow_data_buf.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_buf.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = - unsafe { arrow_data_buf.clone().sliced_unchecked(start, len) }; - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = arrow_data_buf.slice_with_length(start, len); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| { - res_or_opt.map(|v| { - crate::datatypes::Utf8(::re_types_core::ArrowString::from(v)) + .map(|res_or_opt| { + res_or_opt.map(|res_or_opt| { + res_or_opt.map(|v| { + crate::datatypes::Utf8(::re_types_core::ArrowString::from( + v, + )) + }) }) }) - }) - .collect::>>>() - .with_context("rerun.datatypes.Utf8Pair#second")? - .into_iter() + .collect::>>>() + .with_context("rerun.datatypes.Utf8Pair#second")? + .into_iter() } }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( ::itertools::izip!(first, second), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|opt| { opt.map(|(first, second)| { diff --git a/crates/store/re_types/src/datatypes/uuid.rs b/crates/store/re_types/src/datatypes/uuid.rs index 56c95a6893b2..4eb2fae60f50 100644 --- a/crates/store/re_types/src/datatypes/uuid.rs +++ b/crates/store/re_types/src/datatypes/uuid.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -94,20 +94,19 @@ impl ::re_types_core::Loggable for Uuid { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -132,34 +131,30 @@ impl ::re_types_core::Loggable for Uuid { }) .with_context("rerun.datatypes.Uuid#bytes")? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets, - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|(start, end): (usize, usize)| { - debug_assert!(end - start == 16usize); - if end > arrow_data_inner.len() { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets, arrow_data.nulls()) + .map(|elem| { + elem.map(|(start, end): (usize, usize)| { + debug_assert!(end - start == 16usize); + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data.iter().cloned().map(Option::unwrap_or_default); + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data.iter().cloned().map(Option::unwrap_or_default); - // NOTE: Unwrapping cannot fail: the length must be correct. - #[allow(clippy::unwrap_used)] - Ok(array_init::from_iter(data).unwrap()) + // NOTE: Unwrapping cannot fail: the length must be correct. + #[allow(clippy::unwrap_used)] + Ok(array_init::from_iter(data).unwrap()) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } @@ -171,16 +166,15 @@ impl ::re_types_core::Loggable for Uuid { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -188,7 +182,7 @@ impl ::re_types_core::Loggable for Uuid { let slice = { let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::FixedSizeList( std::sync::Arc::new(Field::new("item", DataType::UInt8, false)), @@ -210,7 +204,7 @@ impl ::re_types_core::Loggable for Uuid { }) .with_context("rerun.datatypes.Uuid#bytes")? .values() - .as_slice(), + .as_ref(), ) }; { diff --git a/crates/store/re_types/src/datatypes/uvec2d.rs b/crates/store/re_types/src/datatypes/uvec2d.rs index 73027ab3b0e3..a26a270235d8 100644 --- a/crates/store/re_types/src/datatypes/uvec2d.rs +++ b/crates/store/re_types/src/datatypes/uvec2d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -91,20 +91,19 @@ impl ::re_types_core::Loggable for UVec2D { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -129,34 +128,30 @@ impl ::re_types_core::Loggable for UVec2D { }) .with_context("rerun.datatypes.UVec2D#xy")? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets, - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|(start, end): (usize, usize)| { - debug_assert!(end - start == 2usize); - if end > arrow_data_inner.len() { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets, arrow_data.nulls()) + .map(|elem| { + elem.map(|(start, end): (usize, usize)| { + debug_assert!(end - start == 2usize); + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data.iter().cloned().map(Option::unwrap_or_default); + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data.iter().cloned().map(Option::unwrap_or_default); - // NOTE: Unwrapping cannot fail: the length must be correct. - #[allow(clippy::unwrap_used)] - Ok(array_init::from_iter(data).unwrap()) + // NOTE: Unwrapping cannot fail: the length must be correct. + #[allow(clippy::unwrap_used)] + Ok(array_init::from_iter(data).unwrap()) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } @@ -168,16 +163,15 @@ impl ::re_types_core::Loggable for UVec2D { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -185,7 +179,7 @@ impl ::re_types_core::Loggable for UVec2D { let slice = { let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::FixedSizeList( std::sync::Arc::new(Field::new("item", DataType::UInt32, false)), @@ -207,7 +201,7 @@ impl ::re_types_core::Loggable for UVec2D { }) .with_context("rerun.datatypes.UVec2D#xy")? .values() - .as_slice(), + .as_ref(), ) }; { diff --git a/crates/store/re_types/src/datatypes/uvec3d.rs b/crates/store/re_types/src/datatypes/uvec3d.rs index c2d0688212c7..c78e1830a2f8 100644 --- a/crates/store/re_types/src/datatypes/uvec3d.rs +++ b/crates/store/re_types/src/datatypes/uvec3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -91,20 +91,19 @@ impl ::re_types_core::Loggable for UVec3D { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -129,34 +128,30 @@ impl ::re_types_core::Loggable for UVec3D { }) .with_context("rerun.datatypes.UVec3D#xyz")? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets, - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|(start, end): (usize, usize)| { - debug_assert!(end - start == 3usize); - if end > arrow_data_inner.len() { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets, arrow_data.nulls()) + .map(|elem| { + elem.map(|(start, end): (usize, usize)| { + debug_assert!(end - start == 3usize); + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data.iter().cloned().map(Option::unwrap_or_default); + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data.iter().cloned().map(Option::unwrap_or_default); - // NOTE: Unwrapping cannot fail: the length must be correct. - #[allow(clippy::unwrap_used)] - Ok(array_init::from_iter(data).unwrap()) + // NOTE: Unwrapping cannot fail: the length must be correct. + #[allow(clippy::unwrap_used)] + Ok(array_init::from_iter(data).unwrap()) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } @@ -168,16 +163,15 @@ impl ::re_types_core::Loggable for UVec3D { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -185,7 +179,7 @@ impl ::re_types_core::Loggable for UVec3D { let slice = { let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::FixedSizeList( std::sync::Arc::new(Field::new("item", DataType::UInt32, false)), @@ -207,7 +201,7 @@ impl ::re_types_core::Loggable for UVec3D { }) .with_context("rerun.datatypes.UVec3D#xyz")? .values() - .as_slice(), + .as_ref(), ) }; { diff --git a/crates/store/re_types/src/datatypes/uvec4d.rs b/crates/store/re_types/src/datatypes/uvec4d.rs index 1f081982fec9..5b0df0564772 100644 --- a/crates/store/re_types/src/datatypes/uvec4d.rs +++ b/crates/store/re_types/src/datatypes/uvec4d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -91,20 +91,19 @@ impl ::re_types_core::Loggable for UVec4D { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -129,34 +128,30 @@ impl ::re_types_core::Loggable for UVec4D { }) .with_context("rerun.datatypes.UVec4D#xyzw")? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets, - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|(start, end): (usize, usize)| { - debug_assert!(end - start == 4usize); - if end > arrow_data_inner.len() { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets, arrow_data.nulls()) + .map(|elem| { + elem.map(|(start, end): (usize, usize)| { + debug_assert!(end - start == 4usize); + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data.iter().cloned().map(Option::unwrap_or_default); + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data.iter().cloned().map(Option::unwrap_or_default); - // NOTE: Unwrapping cannot fail: the length must be correct. - #[allow(clippy::unwrap_used)] - Ok(array_init::from_iter(data).unwrap()) + // NOTE: Unwrapping cannot fail: the length must be correct. + #[allow(clippy::unwrap_used)] + Ok(array_init::from_iter(data).unwrap()) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } @@ -168,16 +163,15 @@ impl ::re_types_core::Loggable for UVec4D { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -185,7 +179,7 @@ impl ::re_types_core::Loggable for UVec4D { let slice = { let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::FixedSizeList( std::sync::Arc::new(Field::new("item", DataType::UInt32, false)), @@ -207,7 +201,7 @@ impl ::re_types_core::Loggable for UVec4D { }) .with_context("rerun.datatypes.UVec4D#xyzw")? .values() - .as_slice(), + .as_ref(), ) }; { diff --git a/crates/store/re_types/src/datatypes/vec2d.rs b/crates/store/re_types/src/datatypes/vec2d.rs index a50e5b92d935..ee211fc6268d 100644 --- a/crates/store/re_types/src/datatypes/vec2d.rs +++ b/crates/store/re_types/src/datatypes/vec2d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -91,20 +91,19 @@ impl ::re_types_core::Loggable for Vec2D { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -129,34 +128,30 @@ impl ::re_types_core::Loggable for Vec2D { }) .with_context("rerun.datatypes.Vec2D#xy")? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets, - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|(start, end): (usize, usize)| { - debug_assert!(end - start == 2usize); - if end > arrow_data_inner.len() { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets, arrow_data.nulls()) + .map(|elem| { + elem.map(|(start, end): (usize, usize)| { + debug_assert!(end - start == 2usize); + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data.iter().cloned().map(Option::unwrap_or_default); + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data.iter().cloned().map(Option::unwrap_or_default); - // NOTE: Unwrapping cannot fail: the length must be correct. - #[allow(clippy::unwrap_used)] - Ok(array_init::from_iter(data).unwrap()) + // NOTE: Unwrapping cannot fail: the length must be correct. + #[allow(clippy::unwrap_used)] + Ok(array_init::from_iter(data).unwrap()) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } @@ -168,16 +163,15 @@ impl ::re_types_core::Loggable for Vec2D { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -185,7 +179,7 @@ impl ::re_types_core::Loggable for Vec2D { let slice = { let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::FixedSizeList( std::sync::Arc::new(Field::new("item", DataType::Float32, false)), @@ -207,7 +201,7 @@ impl ::re_types_core::Loggable for Vec2D { }) .with_context("rerun.datatypes.Vec2D#xy")? .values() - .as_slice(), + .as_ref(), ) }; { diff --git a/crates/store/re_types/src/datatypes/vec3d.rs b/crates/store/re_types/src/datatypes/vec3d.rs index 62f096d2e016..705ddaa76eda 100644 --- a/crates/store/re_types/src/datatypes/vec3d.rs +++ b/crates/store/re_types/src/datatypes/vec3d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -91,20 +91,19 @@ impl ::re_types_core::Loggable for Vec3D { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -129,34 +128,30 @@ impl ::re_types_core::Loggable for Vec3D { }) .with_context("rerun.datatypes.Vec3D#xyz")? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets, - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|(start, end): (usize, usize)| { - debug_assert!(end - start == 3usize); - if end > arrow_data_inner.len() { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets, arrow_data.nulls()) + .map(|elem| { + elem.map(|(start, end): (usize, usize)| { + debug_assert!(end - start == 3usize); + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data.iter().cloned().map(Option::unwrap_or_default); + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data.iter().cloned().map(Option::unwrap_or_default); - // NOTE: Unwrapping cannot fail: the length must be correct. - #[allow(clippy::unwrap_used)] - Ok(array_init::from_iter(data).unwrap()) + // NOTE: Unwrapping cannot fail: the length must be correct. + #[allow(clippy::unwrap_used)] + Ok(array_init::from_iter(data).unwrap()) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } @@ -168,16 +163,15 @@ impl ::re_types_core::Loggable for Vec3D { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -185,7 +179,7 @@ impl ::re_types_core::Loggable for Vec3D { let slice = { let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::FixedSizeList( std::sync::Arc::new(Field::new("item", DataType::Float32, false)), @@ -207,7 +201,7 @@ impl ::re_types_core::Loggable for Vec3D { }) .with_context("rerun.datatypes.Vec3D#xyz")? .values() - .as_slice(), + .as_ref(), ) }; { diff --git a/crates/store/re_types/src/datatypes/vec4d.rs b/crates/store/re_types/src/datatypes/vec4d.rs index cf04d4da7c20..8d839b335a52 100644 --- a/crates/store/re_types/src/datatypes/vec4d.rs +++ b/crates/store/re_types/src/datatypes/vec4d.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -91,20 +91,19 @@ impl ::re_types_core::Loggable for Vec4D { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -129,34 +128,30 @@ impl ::re_types_core::Loggable for Vec4D { }) .with_context("rerun.datatypes.Vec4D#xyzw")? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets, - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|(start, end): (usize, usize)| { - debug_assert!(end - start == 4usize); - if end > arrow_data_inner.len() { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets, arrow_data.nulls()) + .map(|elem| { + elem.map(|(start, end): (usize, usize)| { + debug_assert!(end - start == 4usize); + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data.iter().cloned().map(Option::unwrap_or_default); + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data.iter().cloned().map(Option::unwrap_or_default); - // NOTE: Unwrapping cannot fail: the length must be correct. - #[allow(clippy::unwrap_used)] - Ok(array_init::from_iter(data).unwrap()) + // NOTE: Unwrapping cannot fail: the length must be correct. + #[allow(clippy::unwrap_used)] + Ok(array_init::from_iter(data).unwrap()) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } @@ -168,16 +163,15 @@ impl ::re_types_core::Loggable for Vec4D { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -185,7 +179,7 @@ impl ::re_types_core::Loggable for Vec4D { let slice = { let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::FixedSizeList( std::sync::Arc::new(Field::new("item", DataType::Float32, false)), @@ -207,7 +201,7 @@ impl ::re_types_core::Loggable for Vec4D { }) .with_context("rerun.datatypes.Vec4D#xyzw")? .values() - .as_slice(), + .as_ref(), ) }; { diff --git a/crates/store/re_types/src/datatypes/video_timestamp.rs b/crates/store/re_types/src/datatypes/video_timestamp.rs index b572e278c1cc..ed171b0a80fb 100644 --- a/crates/store/re_types/src/datatypes/video_timestamp.rs +++ b/crates/store/re_types/src/datatypes/video_timestamp.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -73,16 +73,15 @@ impl ::re_types_core::Loggable for VideoTimestamp { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -93,7 +92,6 @@ impl ::re_types_core::Loggable for VideoTimestamp { }) .with_context("rerun.datatypes.VideoTimestamp#timestamp_ns")? .into_iter() - .map(|opt| opt.copied()) .map(|v| v.ok_or_else(DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) .collect::>>>() @@ -102,16 +100,15 @@ impl ::re_types_core::Loggable for VideoTimestamp { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -126,7 +123,7 @@ impl ::re_types_core::Loggable for VideoTimestamp { }) .with_context("rerun.datatypes.VideoTimestamp#timestamp_ns")? .values() - .as_slice(); + .as_ref(); { slice.iter().copied().map(Self).collect::>() } diff --git a/crates/store/re_types/src/datatypes/view_coordinates.rs b/crates/store/re_types/src/datatypes/view_coordinates.rs index c290c685fc2b..a4096775b5e9 100644 --- a/crates/store/re_types/src/datatypes/view_coordinates.rs +++ b/crates/store/re_types/src/datatypes/view_coordinates.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -111,20 +111,19 @@ impl ::re_types_core::Loggable for ViewCoordinates { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -149,34 +148,30 @@ impl ::re_types_core::Loggable for ViewCoordinates { }) .with_context("rerun.datatypes.ViewCoordinates#coordinates")? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets, - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|(start, end): (usize, usize)| { - debug_assert!(end - start == 3usize); - if end > arrow_data_inner.len() { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets, arrow_data.nulls()) + .map(|elem| { + elem.map(|(start, end): (usize, usize)| { + debug_assert!(end - start == 3usize); + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data.iter().cloned().map(Option::unwrap_or_default); + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data.iter().cloned().map(Option::unwrap_or_default); - // NOTE: Unwrapping cannot fail: the length must be correct. - #[allow(clippy::unwrap_used)] - Ok(array_init::from_iter(data).unwrap()) + // NOTE: Unwrapping cannot fail: the length must be correct. + #[allow(clippy::unwrap_used)] + Ok(array_init::from_iter(data).unwrap()) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } @@ -188,16 +183,15 @@ impl ::re_types_core::Loggable for ViewCoordinates { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -205,7 +199,7 @@ impl ::re_types_core::Loggable for ViewCoordinates { let slice = { let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::FixedSizeList( std::sync::Arc::new(Field::new("item", DataType::UInt8, false)), @@ -227,7 +221,7 @@ impl ::re_types_core::Loggable for ViewCoordinates { }) .with_context("rerun.datatypes.ViewCoordinates#coordinates")? .values() - .as_slice(), + .as_ref(), ) }; { diff --git a/crates/store/re_types/src/testing/archetypes/affix_fuzzer1.rs b/crates/store/re_types/src/testing/archetypes/affix_fuzzer1.rs index 8eed4f39795a..ab4db1f615bd 100644 --- a/crates/store/re_types/src/testing/archetypes/affix_fuzzer1.rs +++ b/crates/store/re_types/src/testing/archetypes/affix_fuzzer1.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -341,8 +341,8 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -355,7 +355,7 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .get("rerun.testing.components.AffixFuzzer1") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1001")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1001")? .into_iter() .next() @@ -368,7 +368,7 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .get("rerun.testing.components.AffixFuzzer2") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1002")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1002")? .into_iter() .next() @@ -381,7 +381,7 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .get("rerun.testing.components.AffixFuzzer3") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1003")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1003")? .into_iter() .next() @@ -394,7 +394,7 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .get("rerun.testing.components.AffixFuzzer4") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1004")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1004")? .into_iter() .next() @@ -407,7 +407,7 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .get("rerun.testing.components.AffixFuzzer5") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1005")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1005")? .into_iter() .next() @@ -420,7 +420,7 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .get("rerun.testing.components.AffixFuzzer6") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1006")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1006")? .into_iter() .next() @@ -433,7 +433,7 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .get("rerun.testing.components.AffixFuzzer7") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1007")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1007")? .into_iter() .next() @@ -446,7 +446,7 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .get("rerun.testing.components.AffixFuzzer8") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1008")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1008")? .into_iter() .next() @@ -459,7 +459,7 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .get("rerun.testing.components.AffixFuzzer9") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1009")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1009")? .into_iter() .next() @@ -472,7 +472,7 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .get("rerun.testing.components.AffixFuzzer10") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1010")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1010")? .into_iter() .next() @@ -485,7 +485,7 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .get("rerun.testing.components.AffixFuzzer11") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1011")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1011")? .into_iter() .next() @@ -498,7 +498,7 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .get("rerun.testing.components.AffixFuzzer12") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1012")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1012")? .into_iter() .next() @@ -511,7 +511,7 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .get("rerun.testing.components.AffixFuzzer13") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1013")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1013")? .into_iter() .next() @@ -524,7 +524,7 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .get("rerun.testing.components.AffixFuzzer14") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1014")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1014")? .into_iter() .next() @@ -537,7 +537,7 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .get("rerun.testing.components.AffixFuzzer15") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1015")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1015")? .into_iter() .next() @@ -550,7 +550,7 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .get("rerun.testing.components.AffixFuzzer16") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1016")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1016")? .into_iter() .next() @@ -563,7 +563,7 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .get("rerun.testing.components.AffixFuzzer17") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1017")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1017")? .into_iter() .next() @@ -576,7 +576,7 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .get("rerun.testing.components.AffixFuzzer18") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1018")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1018")? .into_iter() .next() @@ -589,7 +589,7 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .get("rerun.testing.components.AffixFuzzer19") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1019")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1019")? .into_iter() .next() @@ -602,7 +602,7 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .get("rerun.testing.components.AffixFuzzer20") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1020")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1020")? .into_iter() .next() @@ -615,7 +615,7 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .get("rerun.testing.components.AffixFuzzer21") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1021")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1021")? .into_iter() .next() @@ -628,7 +628,7 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .get("rerun.testing.components.AffixFuzzer22") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1022")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1022")? .into_iter() .next() diff --git a/crates/store/re_types/src/testing/archetypes/affix_fuzzer2.rs b/crates/store/re_types/src/testing/archetypes/affix_fuzzer2.rs index 28cb64bfebc6..64d98e9150b0 100644 --- a/crates/store/re_types/src/testing/archetypes/affix_fuzzer2.rs +++ b/crates/store/re_types/src/testing/archetypes/affix_fuzzer2.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -308,8 +308,8 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -322,7 +322,7 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .get("rerun.testing.components.AffixFuzzer1") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1101")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1101")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -334,7 +334,7 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .get("rerun.testing.components.AffixFuzzer2") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1102")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1102")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -346,7 +346,7 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .get("rerun.testing.components.AffixFuzzer3") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1103")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1103")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -358,7 +358,7 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .get("rerun.testing.components.AffixFuzzer4") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1104")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1104")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -370,7 +370,7 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .get("rerun.testing.components.AffixFuzzer5") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1105")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1105")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -382,7 +382,7 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .get("rerun.testing.components.AffixFuzzer6") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1106")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1106")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -394,7 +394,7 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .get("rerun.testing.components.AffixFuzzer7") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1107")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1107")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -406,7 +406,7 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .get("rerun.testing.components.AffixFuzzer8") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1108")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1108")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -418,7 +418,7 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .get("rerun.testing.components.AffixFuzzer9") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1109")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1109")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -430,7 +430,7 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .get("rerun.testing.components.AffixFuzzer10") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1110")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1110")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -442,7 +442,7 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .get("rerun.testing.components.AffixFuzzer11") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1111")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1111")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -454,7 +454,7 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .get("rerun.testing.components.AffixFuzzer12") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1112")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1112")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -466,7 +466,7 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .get("rerun.testing.components.AffixFuzzer13") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1113")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1113")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -478,7 +478,7 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .get("rerun.testing.components.AffixFuzzer14") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1114")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1114")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -490,7 +490,7 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .get("rerun.testing.components.AffixFuzzer15") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1115")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1115")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -502,7 +502,7 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .get("rerun.testing.components.AffixFuzzer16") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1116")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1116")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -514,7 +514,7 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .get("rerun.testing.components.AffixFuzzer17") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1117")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1117")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -526,7 +526,7 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .get("rerun.testing.components.AffixFuzzer18") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1118")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1118")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -538,7 +538,7 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .get("rerun.testing.components.AffixFuzzer22") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1122")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1122")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) diff --git a/crates/store/re_types/src/testing/archetypes/affix_fuzzer3.rs b/crates/store/re_types/src/testing/archetypes/affix_fuzzer3.rs index 643d315ff076..a1a58b8f377c 100644 --- a/crates/store/re_types/src/testing/archetypes/affix_fuzzer3.rs +++ b/crates/store/re_types/src/testing/archetypes/affix_fuzzer3.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -297,8 +297,8 @@ impl ::re_types_core::Archetype for AffixFuzzer3 { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -308,7 +308,7 @@ impl ::re_types_core::Archetype for AffixFuzzer3 { .collect(); let fuzz2001 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer1") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2001")? .into_iter() .next() @@ -318,7 +318,7 @@ impl ::re_types_core::Archetype for AffixFuzzer3 { }; let fuzz2002 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer2") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2002")? .into_iter() .next() @@ -328,7 +328,7 @@ impl ::re_types_core::Archetype for AffixFuzzer3 { }; let fuzz2003 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer3") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2003")? .into_iter() .next() @@ -338,7 +338,7 @@ impl ::re_types_core::Archetype for AffixFuzzer3 { }; let fuzz2004 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer4") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2004")? .into_iter() .next() @@ -348,7 +348,7 @@ impl ::re_types_core::Archetype for AffixFuzzer3 { }; let fuzz2005 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer5") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2005")? .into_iter() .next() @@ -358,7 +358,7 @@ impl ::re_types_core::Archetype for AffixFuzzer3 { }; let fuzz2006 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer6") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2006")? .into_iter() .next() @@ -368,7 +368,7 @@ impl ::re_types_core::Archetype for AffixFuzzer3 { }; let fuzz2007 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer7") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2007")? .into_iter() .next() @@ -378,7 +378,7 @@ impl ::re_types_core::Archetype for AffixFuzzer3 { }; let fuzz2008 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer8") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2008")? .into_iter() .next() @@ -388,7 +388,7 @@ impl ::re_types_core::Archetype for AffixFuzzer3 { }; let fuzz2009 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer9") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2009")? .into_iter() .next() @@ -398,7 +398,7 @@ impl ::re_types_core::Archetype for AffixFuzzer3 { }; let fuzz2010 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer10") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2010")? .into_iter() .next() @@ -408,7 +408,7 @@ impl ::re_types_core::Archetype for AffixFuzzer3 { }; let fuzz2011 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer11") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2011")? .into_iter() .next() @@ -418,7 +418,7 @@ impl ::re_types_core::Archetype for AffixFuzzer3 { }; let fuzz2012 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer12") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2012")? .into_iter() .next() @@ -428,7 +428,7 @@ impl ::re_types_core::Archetype for AffixFuzzer3 { }; let fuzz2013 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer13") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2013")? .into_iter() .next() @@ -438,7 +438,7 @@ impl ::re_types_core::Archetype for AffixFuzzer3 { }; let fuzz2014 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer14") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2014")? .into_iter() .next() @@ -448,7 +448,7 @@ impl ::re_types_core::Archetype for AffixFuzzer3 { }; let fuzz2015 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer15") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2015")? .into_iter() .next() @@ -458,7 +458,7 @@ impl ::re_types_core::Archetype for AffixFuzzer3 { }; let fuzz2016 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer16") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2016")? .into_iter() .next() @@ -468,7 +468,7 @@ impl ::re_types_core::Archetype for AffixFuzzer3 { }; let fuzz2017 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer17") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2017")? .into_iter() .next() @@ -478,7 +478,7 @@ impl ::re_types_core::Archetype for AffixFuzzer3 { }; let fuzz2018 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer18") { - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2018")? .into_iter() .next() diff --git a/crates/store/re_types/src/testing/archetypes/affix_fuzzer4.rs b/crates/store/re_types/src/testing/archetypes/affix_fuzzer4.rs index e3f2d70e7783..237868f3fe85 100644 --- a/crates/store/re_types/src/testing/archetypes/affix_fuzzer4.rs +++ b/crates/store/re_types/src/testing/archetypes/affix_fuzzer4.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -297,8 +297,8 @@ impl ::re_types_core::Archetype for AffixFuzzer4 { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; @@ -309,7 +309,7 @@ impl ::re_types_core::Archetype for AffixFuzzer4 { let fuzz2101 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer1") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2101")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -322,7 +322,7 @@ impl ::re_types_core::Archetype for AffixFuzzer4 { let fuzz2102 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer2") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2102")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -335,7 +335,7 @@ impl ::re_types_core::Archetype for AffixFuzzer4 { let fuzz2103 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer3") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2103")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -348,7 +348,7 @@ impl ::re_types_core::Archetype for AffixFuzzer4 { let fuzz2104 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer4") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2104")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -361,7 +361,7 @@ impl ::re_types_core::Archetype for AffixFuzzer4 { let fuzz2105 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer5") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2105")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -374,7 +374,7 @@ impl ::re_types_core::Archetype for AffixFuzzer4 { let fuzz2106 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer6") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2106")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -387,7 +387,7 @@ impl ::re_types_core::Archetype for AffixFuzzer4 { let fuzz2107 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer7") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2107")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -400,7 +400,7 @@ impl ::re_types_core::Archetype for AffixFuzzer4 { let fuzz2108 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer8") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2108")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -413,7 +413,7 @@ impl ::re_types_core::Archetype for AffixFuzzer4 { let fuzz2109 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer9") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2109")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -426,7 +426,7 @@ impl ::re_types_core::Archetype for AffixFuzzer4 { let fuzz2110 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer10") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2110")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -439,7 +439,7 @@ impl ::re_types_core::Archetype for AffixFuzzer4 { let fuzz2111 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer11") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2111")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -452,7 +452,7 @@ impl ::re_types_core::Archetype for AffixFuzzer4 { let fuzz2112 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer12") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2112")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -465,7 +465,7 @@ impl ::re_types_core::Archetype for AffixFuzzer4 { let fuzz2113 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer13") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2113")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -478,7 +478,7 @@ impl ::re_types_core::Archetype for AffixFuzzer4 { let fuzz2114 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer14") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2114")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -491,7 +491,7 @@ impl ::re_types_core::Archetype for AffixFuzzer4 { let fuzz2115 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer15") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2115")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -504,7 +504,7 @@ impl ::re_types_core::Archetype for AffixFuzzer4 { let fuzz2116 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer16") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2116")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -517,7 +517,7 @@ impl ::re_types_core::Archetype for AffixFuzzer4 { let fuzz2117 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer17") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2117")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) @@ -530,7 +530,7 @@ impl ::re_types_core::Archetype for AffixFuzzer4 { let fuzz2118 = if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer18") { Some({ - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2118")? .into_iter() .map(|v| v.ok_or_else(DeserializationError::missing_data)) diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer1.rs b/crates/store/re_types/src/testing/components/affix_fuzzer1.rs index 967ddc99930a..e4fcef85bf43 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer1.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer1.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -50,13 +50,13 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::testing::datatypes::AffixFuzzer1::from_arrow2_opt(arrow_data) + crate::testing::datatypes::AffixFuzzer1::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer10.rs b/crates/store/re_types/src/testing/components/affix_fuzzer10.rs index 739d7de755cc..e0ffb422ee48 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer10.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer10.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -81,20 +81,19 @@ impl ::re_types_core::Loggable for AffixFuzzer10 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -103,35 +102,32 @@ impl ::re_types_core::Loggable for AffixFuzzer10 { .with_context("rerun.testing.components.AffixFuzzer10#single_string_optional")?; let arrow_data_buf = arrow_data.values(); let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - let len = end - start; - if arrow_data_buf.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_buf.len(), - )); - } - - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_buf.clone().sliced_unchecked(start, len) }; - Ok(data) + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + let len = end - start; + if arrow_data_buf.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_buf.len(), + )); + } + + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = arrow_data_buf.slice_with_length(start, len); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt - .map(|res_or_opt| res_or_opt.map(|v| ::re_types_core::ArrowString::from(v))) - }) - .collect::>>>() - .with_context("rerun.testing.components.AffixFuzzer10#single_string_optional")? - .into_iter() + .map(|res_or_opt| { + res_or_opt + .map(|res_or_opt| res_or_opt.map(|v| ::re_types_core::ArrowString::from(v))) + }) + .collect::>>>() + .with_context("rerun.testing.components.AffixFuzzer10#single_string_optional")? + .into_iter() } .map(Ok) .map(|res| res.map(|v| Some(Self(v)))) diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer11.rs b/crates/store/re_types/src/testing/components/affix_fuzzer11.rs index 142b2b88218f..93c4ebc47b14 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer11.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer11.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -92,20 +92,19 @@ impl ::re_types_core::Loggable for AffixFuzzer11 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -131,33 +130,26 @@ impl ::re_types_core::Loggable for AffixFuzzer11 { .values() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } - - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { - arrow_data_inner - .clone() - .sliced_unchecked(start, end - start) - }; - let data = ::re_types_core::ArrowBuffer::from(data); - Ok(data) + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } + + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = arrow_data_inner.clone().slice(start, end - start); + let data = ::re_types_core::ArrowBuffer::from(data); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer12.rs b/crates/store/re_types/src/testing/components/affix_fuzzer12.rs index e3f13d3a9d4b..e9424fdff051 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer12.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer12.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -96,20 +96,19 @@ impl ::re_types_core::Loggable for AffixFuzzer12 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -124,7 +123,7 @@ impl ::re_types_core::Loggable for AffixFuzzer12 { { let arrow_data_inner = arrow_data_inner .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::Utf8; let actual = arrow_data_inner.data_type().clone(); @@ -135,71 +134,63 @@ impl ::re_types_core::Loggable for AffixFuzzer12 { )?; let arrow_data_inner_buf = arrow_data_inner.values(); let offsets = arrow_data_inner.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data_inner.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - let len = end - start; - if arrow_data_inner_buf.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner_buf.len(), - )); - } - - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { - arrow_data_inner_buf.clone().sliced_unchecked(start, len) - }; - Ok(data) + ZipValidity::new_with_validity(offsets.windows(2), arrow_data_inner.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + let len = end - start; + if arrow_data_inner_buf.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner_buf.len(), + )); + } + + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = arrow_data_inner_buf.slice_with_length(start, len); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| { - res_or_opt.map(|v| ::re_types_core::ArrowString::from(v)) + .map(|res_or_opt| { + res_or_opt.map(|res_or_opt| { + res_or_opt.map(|v| ::re_types_core::ArrowString::from(v)) + }) }) - }) - .collect::>>>() - .with_context( - "rerun.testing.components.AffixFuzzer12#many_strings_required", - )? - .into_iter() + .collect::>>>() + .with_context( + "rerun.testing.components.AffixFuzzer12#many_strings_required", + )? + .into_iter() } .collect::>() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } - - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data - .iter() - .cloned() - .map(Option::unwrap_or_default) - .collect(); - Ok(data) + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } + + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data + .iter() + .cloned() + .map(Option::unwrap_or_default) + .collect(); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer13.rs b/crates/store/re_types/src/testing/components/affix_fuzzer13.rs index 9118de31e42a..888b45df6d44 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer13.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer13.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -96,20 +96,19 @@ impl ::re_types_core::Loggable for AffixFuzzer13 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -124,7 +123,7 @@ impl ::re_types_core::Loggable for AffixFuzzer13 { { let arrow_data_inner = arrow_data_inner .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::Utf8; let actual = arrow_data_inner.data_type().clone(); @@ -135,71 +134,63 @@ impl ::re_types_core::Loggable for AffixFuzzer13 { )?; let arrow_data_inner_buf = arrow_data_inner.values(); let offsets = arrow_data_inner.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data_inner.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - let len = end - start; - if arrow_data_inner_buf.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner_buf.len(), - )); - } - - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { - arrow_data_inner_buf.clone().sliced_unchecked(start, len) - }; - Ok(data) + ZipValidity::new_with_validity(offsets.windows(2), arrow_data_inner.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + let len = end - start; + if arrow_data_inner_buf.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner_buf.len(), + )); + } + + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = arrow_data_inner_buf.slice_with_length(start, len); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| { - res_or_opt.map(|v| ::re_types_core::ArrowString::from(v)) + .map(|res_or_opt| { + res_or_opt.map(|res_or_opt| { + res_or_opt.map(|v| ::re_types_core::ArrowString::from(v)) + }) }) - }) - .collect::>>>() - .with_context( - "rerun.testing.components.AffixFuzzer13#many_strings_optional", - )? - .into_iter() + .collect::>>>() + .with_context( + "rerun.testing.components.AffixFuzzer13#many_strings_optional", + )? + .into_iter() } .collect::>() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } - - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data - .iter() - .cloned() - .map(Option::unwrap_or_default) - .collect(); - Ok(data) + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } + + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data + .iter() + .cloned() + .map(Option::unwrap_or_default) + .collect(); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer14.rs b/crates/store/re_types/src/testing/components/affix_fuzzer14.rs index 9e3e6dd8afdd..66e1f08852ff 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer14.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer14.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -50,13 +50,13 @@ impl ::re_types_core::Loggable for AffixFuzzer14 { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::testing::datatypes::AffixFuzzer3::from_arrow2_opt(arrow_data) + crate::testing::datatypes::AffixFuzzer3::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer15.rs b/crates/store/re_types/src/testing/components/affix_fuzzer15.rs index 674d8a6eb4cd..c52e0634ed97 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer15.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer15.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -95,18 +95,17 @@ impl ::re_types_core::Loggable for AffixFuzzer15 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok( - crate::testing::datatypes::AffixFuzzer3::from_arrow2_opt(arrow_data) + crate::testing::datatypes::AffixFuzzer3::from_arrow_opt(arrow_data) .with_context("rerun.testing.components.AffixFuzzer15#single_optional_union")? .into_iter() .map(Ok) diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer16.rs b/crates/store/re_types/src/testing/components/affix_fuzzer16.rs index 605c7831b803..eb367c26de2a 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer16.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer16.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -92,20 +92,19 @@ impl ::re_types_core::Loggable for AffixFuzzer16 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -117,7 +116,7 @@ impl ::re_types_core::Loggable for AffixFuzzer16 { } else { let arrow_data_inner = { let arrow_data_inner = &**arrow_data.values(); - crate::testing::datatypes::AffixFuzzer3::from_arrow2_opt(arrow_data_inner) + crate::testing::datatypes::AffixFuzzer3::from_arrow_opt(arrow_data_inner) .with_context( "rerun.testing.components.AffixFuzzer16#many_required_unions", )? @@ -125,33 +124,30 @@ impl ::re_types_core::Loggable for AffixFuzzer16 { .collect::>() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data - .iter() - .cloned() - .map(Option::unwrap_or_default) - .collect(); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data + .iter() + .cloned() + .map(Option::unwrap_or_default) + .collect(); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer17.rs b/crates/store/re_types/src/testing/components/affix_fuzzer17.rs index 5c3584825e37..54a2b4129ffd 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer17.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer17.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -92,20 +92,19 @@ impl ::re_types_core::Loggable for AffixFuzzer17 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -117,7 +116,7 @@ impl ::re_types_core::Loggable for AffixFuzzer17 { } else { let arrow_data_inner = { let arrow_data_inner = &**arrow_data.values(); - crate::testing::datatypes::AffixFuzzer3::from_arrow2_opt(arrow_data_inner) + crate::testing::datatypes::AffixFuzzer3::from_arrow_opt(arrow_data_inner) .with_context( "rerun.testing.components.AffixFuzzer17#many_optional_unions", )? @@ -125,33 +124,30 @@ impl ::re_types_core::Loggable for AffixFuzzer17 { .collect::>() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data - .iter() - .cloned() - .map(Option::unwrap_or_default) - .collect(); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data + .iter() + .cloned() + .map(Option::unwrap_or_default) + .collect(); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer18.rs b/crates/store/re_types/src/testing/components/affix_fuzzer18.rs index 0ee06f26d382..63349a8e50a4 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer18.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer18.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -92,20 +92,19 @@ impl ::re_types_core::Loggable for AffixFuzzer18 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -117,7 +116,7 @@ impl ::re_types_core::Loggable for AffixFuzzer18 { } else { let arrow_data_inner = { let arrow_data_inner = &**arrow_data.values(); - crate::testing::datatypes::AffixFuzzer4::from_arrow2_opt(arrow_data_inner) + crate::testing::datatypes::AffixFuzzer4::from_arrow_opt(arrow_data_inner) .with_context( "rerun.testing.components.AffixFuzzer18#many_optional_unions", )? @@ -125,33 +124,30 @@ impl ::re_types_core::Loggable for AffixFuzzer18 { .collect::>() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data - .iter() - .cloned() - .map(Option::unwrap_or_default) - .collect(); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data + .iter() + .cloned() + .map(Option::unwrap_or_default) + .collect(); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer19.rs b/crates/store/re_types/src/testing/components/affix_fuzzer19.rs index 1a5b51bc9069..76c685d9b4be 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer19.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer19.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -50,13 +50,13 @@ impl ::re_types_core::Loggable for AffixFuzzer19 { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::testing::datatypes::AffixFuzzer5::from_arrow2_opt(arrow_data) + crate::testing::datatypes::AffixFuzzer5::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer2.rs b/crates/store/re_types/src/testing/components/affix_fuzzer2.rs index 32e9c765e816..54ae02035757 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer2.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer2.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -50,13 +50,13 @@ impl ::re_types_core::Loggable for AffixFuzzer2 { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::testing::datatypes::AffixFuzzer1::from_arrow2_opt(arrow_data) + crate::testing::datatypes::AffixFuzzer1::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer20.rs b/crates/store/re_types/src/testing/components/affix_fuzzer20.rs index 03d4e6af555b..4983b0c62bce 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer20.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer20.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -50,13 +50,13 @@ impl ::re_types_core::Loggable for AffixFuzzer20 { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::testing::datatypes::AffixFuzzer20::from_arrow2_opt(arrow_data) + crate::testing::datatypes::AffixFuzzer20::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer21.rs b/crates/store/re_types/src/testing/components/affix_fuzzer21.rs index 1455cba6c48a..6830da2c82ab 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer21.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer21.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -50,13 +50,13 @@ impl ::re_types_core::Loggable for AffixFuzzer21 { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::testing::datatypes::AffixFuzzer21::from_arrow2_opt(arrow_data) + crate::testing::datatypes::AffixFuzzer21::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer22.rs b/crates/store/re_types/src/testing/components/affix_fuzzer22.rs index 7e74d392baaf..b19f1a95dc62 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer22.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer22.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -75,18 +75,17 @@ impl ::re_types_core::Loggable for AffixFuzzer22 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok( - crate::testing::datatypes::AffixFuzzer22::from_arrow2_opt(arrow_data) + crate::testing::datatypes::AffixFuzzer22::from_arrow_opt(arrow_data) .with_context("rerun.testing.components.AffixFuzzer22#nullable_nested_array")? .into_iter() .map(Ok) diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer23.rs b/crates/store/re_types/src/testing/components/affix_fuzzer23.rs index 9ece4182d69c..7d232fe5098d 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer23.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer23.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -79,18 +79,17 @@ impl ::re_types_core::Loggable for AffixFuzzer23 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok( - crate::testing::datatypes::MultiEnum::from_arrow2_opt(arrow_data) + crate::testing::datatypes::MultiEnum::from_arrow_opt(arrow_data) .with_context("rerun.testing.components.AffixFuzzer23#multi_enum")? .into_iter() .map(Ok) diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer3.rs b/crates/store/re_types/src/testing/components/affix_fuzzer3.rs index 3dc4948654ae..5bf77e3943fa 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer3.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer3.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -50,13 +50,13 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::testing::datatypes::AffixFuzzer1::from_arrow2_opt(arrow_data) + crate::testing::datatypes::AffixFuzzer1::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer4.rs b/crates/store/re_types/src/testing/components/affix_fuzzer4.rs index 0759fa56d94f..a25c1f30c170 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer4.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer4.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -106,18 +106,17 @@ impl ::re_types_core::Loggable for AffixFuzzer4 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok( - crate::testing::datatypes::AffixFuzzer1::from_arrow2_opt(arrow_data) + crate::testing::datatypes::AffixFuzzer1::from_arrow_opt(arrow_data) .with_context("rerun.testing.components.AffixFuzzer4#single_optional")? .into_iter() .map(Ok) diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer5.rs b/crates/store/re_types/src/testing/components/affix_fuzzer5.rs index d86667953fd2..2e8933158ac4 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer5.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer5.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -106,18 +106,17 @@ impl ::re_types_core::Loggable for AffixFuzzer5 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok( - crate::testing::datatypes::AffixFuzzer1::from_arrow2_opt(arrow_data) + crate::testing::datatypes::AffixFuzzer1::from_arrow_opt(arrow_data) .with_context("rerun.testing.components.AffixFuzzer5#single_optional")? .into_iter() .map(Ok) diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer6.rs b/crates/store/re_types/src/testing/components/affix_fuzzer6.rs index 119e829355e7..5788a4af1b33 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer6.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer6.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -106,18 +106,17 @@ impl ::re_types_core::Loggable for AffixFuzzer6 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok( - crate::testing::datatypes::AffixFuzzer1::from_arrow2_opt(arrow_data) + crate::testing::datatypes::AffixFuzzer1::from_arrow_opt(arrow_data) .with_context("rerun.testing.components.AffixFuzzer6#single_optional")? .into_iter() .map(Ok) diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer7.rs b/crates/store/re_types/src/testing/components/affix_fuzzer7.rs index 74fa0a201a01..517ed02143e5 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer7.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer7.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -92,20 +92,19 @@ impl ::re_types_core::Loggable for AffixFuzzer7 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -117,39 +116,36 @@ impl ::re_types_core::Loggable for AffixFuzzer7 { } else { let arrow_data_inner = { let arrow_data_inner = &**arrow_data.values(); - crate::testing::datatypes::AffixFuzzer1::from_arrow2_opt(arrow_data_inner) + crate::testing::datatypes::AffixFuzzer1::from_arrow_opt(arrow_data_inner) .with_context("rerun.testing.components.AffixFuzzer7#many_optional")? .into_iter() .collect::>() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data - .iter() - .cloned() - .map(Option::unwrap_or_default) - .collect(); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data + .iter() + .cloned() + .map(Option::unwrap_or_default) + .collect(); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer8.rs b/crates/store/re_types/src/testing/components/affix_fuzzer8.rs index 9bbec3a8735f..0422bf29ef22 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer8.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer8.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -73,16 +73,15 @@ impl ::re_types_core::Loggable for AffixFuzzer8 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -93,7 +92,6 @@ impl ::re_types_core::Loggable for AffixFuzzer8 { }) .with_context("rerun.testing.components.AffixFuzzer8#single_float_optional")? .into_iter() - .map(|opt| opt.copied()) .map(Ok) .map(|res| res.map(|v| Some(Self(v)))) .collect::>>>() diff --git a/crates/store/re_types/src/testing/components/affix_fuzzer9.rs b/crates/store/re_types/src/testing/components/affix_fuzzer9.rs index a5d0d98442cd..ecc4bf620d88 100644 --- a/crates/store/re_types/src/testing/components/affix_fuzzer9.rs +++ b/crates/store/re_types/src/testing/components/affix_fuzzer9.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -81,20 +81,19 @@ impl ::re_types_core::Loggable for AffixFuzzer9 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -103,35 +102,32 @@ impl ::re_types_core::Loggable for AffixFuzzer9 { .with_context("rerun.testing.components.AffixFuzzer9#single_string_required")?; let arrow_data_buf = arrow_data.values(); let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - let len = end - start; - if arrow_data_buf.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_buf.len(), - )); - } - - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_buf.clone().sliced_unchecked(start, len) }; - Ok(data) + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + let len = end - start; + if arrow_data_buf.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_buf.len(), + )); + } + + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = arrow_data_buf.slice_with_length(start, len); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt - .map(|res_or_opt| res_or_opt.map(|v| ::re_types_core::ArrowString::from(v))) - }) - .collect::>>>() - .with_context("rerun.testing.components.AffixFuzzer9#single_string_required")? - .into_iter() + .map(|res_or_opt| { + res_or_opt + .map(|res_or_opt| res_or_opt.map(|v| ::re_types_core::ArrowString::from(v))) + }) + .collect::>>>() + .with_context("rerun.testing.components.AffixFuzzer9#single_string_required")? + .into_iter() } .map(|v| v.ok_or_else(DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) diff --git a/crates/store/re_types/src/testing/datatypes/affix_fuzzer1.rs b/crates/store/re_types/src/testing/datatypes/affix_fuzzer1.rs index 4cec3891a667..f96ee9933c69 100644 --- a/crates/store/re_types/src/testing/datatypes/affix_fuzzer1.rs +++ b/crates/store/re_types/src/testing/datatypes/affix_fuzzer1.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -468,20 +468,19 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -492,10 +491,10 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let single_float_optional = { @@ -517,7 +516,6 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { }) .with_context("rerun.testing.datatypes.AffixFuzzer1#single_float_optional")? .into_iter() - .map(|opt| opt.copied()) }; let single_string_required = { if !arrays_by_name.contains_key("single_string_required") { @@ -531,7 +529,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::Utf8; let actual = arrow_data.data_type().clone(); @@ -542,39 +540,35 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { )?; let arrow_data_buf = arrow_data.values(); let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - let len = end - start; - if arrow_data_buf.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_buf.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + let len = end - start; + if arrow_data_buf.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_buf.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = - unsafe { arrow_data_buf.clone().sliced_unchecked(start, len) }; - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = arrow_data_buf.slice_with_length(start, len); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| { - res_or_opt.map(|v| ::re_types_core::ArrowString::from(v)) + .map(|res_or_opt| { + res_or_opt.map(|res_or_opt| { + res_or_opt.map(|v| ::re_types_core::ArrowString::from(v)) + }) }) - }) - .collect::>>>() - .with_context( - "rerun.testing.datatypes.AffixFuzzer1#single_string_required", - )? - .into_iter() + .collect::>>>() + .with_context( + "rerun.testing.datatypes.AffixFuzzer1#single_string_required", + )? + .into_iter() } }; let single_string_optional = { @@ -589,7 +583,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::Utf8; let actual = arrow_data.data_type().clone(); @@ -600,39 +594,35 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { )?; let arrow_data_buf = arrow_data.values(); let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - let len = end - start; - if arrow_data_buf.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_buf.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + let len = end - start; + if arrow_data_buf.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_buf.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = - unsafe { arrow_data_buf.clone().sliced_unchecked(start, len) }; - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = arrow_data_buf.slice_with_length(start, len); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| { - res_or_opt.map(|v| ::re_types_core::ArrowString::from(v)) + .map(|res_or_opt| { + res_or_opt.map(|res_or_opt| { + res_or_opt.map(|v| ::re_types_core::ArrowString::from(v)) + }) }) - }) - .collect::>>>() - .with_context( - "rerun.testing.datatypes.AffixFuzzer1#single_string_optional", - )? - .into_iter() + .collect::>>>() + .with_context( + "rerun.testing.datatypes.AffixFuzzer1#single_string_optional", + )? + .into_iter() } }; let many_floats_optional = { @@ -647,7 +637,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", @@ -679,33 +669,27 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { .values() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { - arrow_data_inner - .clone() - .sliced_unchecked(start, end - start) - }; - let data = ::re_types_core::ArrowBuffer::from(data); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + arrow_data_inner.clone().slice(start, end - start); + let data = ::re_types_core::ArrowBuffer::from(data); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } @@ -722,7 +706,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", @@ -743,7 +727,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { { let arrow_data_inner = arrow_data_inner .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::Utf8; let actual = arrow_data_inner.data_type().clone(); @@ -754,9 +738,9 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { )?; let arrow_data_inner_buf = arrow_data_inner.values(); let offsets = arrow_data_inner.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( offsets.windows(2), - arrow_data_inner.validity(), + arrow_data_inner.nulls(), ) .map(|elem| { elem @@ -774,9 +758,8 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { - arrow_data_inner_buf.clone().sliced_unchecked(start, len) - }; + let data = arrow_data_inner_buf + .slice_with_length(start, len); Ok(data) }) .transpose() @@ -796,9 +779,9 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { .collect::>() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( offsets.windows(2), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|elem| { elem @@ -844,7 +827,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", @@ -865,7 +848,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { { let arrow_data_inner = arrow_data_inner .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::Utf8; let actual = arrow_data_inner.data_type().clone(); @@ -876,9 +859,9 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { )?; let arrow_data_inner_buf = arrow_data_inner.values(); let offsets = arrow_data_inner.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( offsets.windows(2), - arrow_data_inner.validity(), + arrow_data_inner.nulls(), ) .map(|elem| { elem @@ -896,9 +879,8 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { - arrow_data_inner_buf.clone().sliced_unchecked(start, len) - }; + let data = arrow_data_inner_buf + .slice_with_length(start, len); Ok(data) }) .transpose() @@ -918,9 +900,9 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { .collect::>() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( offsets.windows(2), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|elem| { elem @@ -973,7 +955,6 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { }) .with_context("rerun.testing.datatypes.AffixFuzzer1#flattened_scalar")? .into_iter() - .map(|opt| opt.copied()) }; let almost_flattened_scalar = { if !arrays_by_name.contains_key("almost_flattened_scalar") { @@ -984,7 +965,7 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { .with_context("rerun.testing.datatypes.AffixFuzzer1"); } let arrow_data = &**arrays_by_name["almost_flattened_scalar"]; - crate::testing::datatypes::FlattenedScalar::from_arrow2_opt(arrow_data) + crate::testing::datatypes::FlattenedScalar::from_arrow_opt(arrow_data) .with_context( "rerun.testing.datatypes.AffixFuzzer1#almost_flattened_scalar", )? @@ -1010,14 +991,14 @@ impl ::re_types_core::Loggable for AffixFuzzer1 { .with_context("rerun.testing.datatypes.AffixFuzzer1#from_parent")? .into_iter() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( ::itertools::izip!( single_float_optional, single_string_required, single_string_optional, many_floats_optional, many_strings_required, many_strings_optional, flattened_scalar, almost_flattened_scalar, from_parent ), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|opt| { opt diff --git a/crates/store/re_types/src/testing/datatypes/affix_fuzzer2.rs b/crates/store/re_types/src/testing/datatypes/affix_fuzzer2.rs index 07e674e03429..59b6b37dd4e6 100644 --- a/crates/store/re_types/src/testing/datatypes/affix_fuzzer2.rs +++ b/crates/store/re_types/src/testing/datatypes/affix_fuzzer2.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -66,16 +66,15 @@ impl ::re_types_core::Loggable for AffixFuzzer2 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -86,7 +85,6 @@ impl ::re_types_core::Loggable for AffixFuzzer2 { }) .with_context("rerun.testing.datatypes.AffixFuzzer2#single_float_optional")? .into_iter() - .map(|opt| opt.copied()) .map(Ok) .map(|res| res.map(|v| Some(Self(v)))) .collect::>>>() diff --git a/crates/store/re_types/src/testing/datatypes/affix_fuzzer20.rs b/crates/store/re_types/src/testing/datatypes/affix_fuzzer20.rs index 36adf314259f..7b5a77a56661 100644 --- a/crates/store/re_types/src/testing/datatypes/affix_fuzzer20.rs +++ b/crates/store/re_types/src/testing/datatypes/affix_fuzzer20.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -138,20 +138,19 @@ impl ::re_types_core::Loggable for AffixFuzzer20 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -162,10 +161,10 @@ impl ::re_types_core::Loggable for AffixFuzzer20 { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let p = { @@ -187,7 +186,6 @@ impl ::re_types_core::Loggable for AffixFuzzer20 { }) .with_context("rerun.testing.datatypes.AffixFuzzer20#p")? .into_iter() - .map(|opt| opt.copied()) .map(|res_or_opt| { res_or_opt.map(crate::testing::datatypes::PrimitiveComponent) }) @@ -204,7 +202,7 @@ impl ::re_types_core::Loggable for AffixFuzzer20 { { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::Utf8; let actual = arrow_data.data_type().clone(); @@ -213,60 +211,53 @@ impl ::re_types_core::Loggable for AffixFuzzer20 { .with_context("rerun.testing.datatypes.AffixFuzzer20#s")?; let arrow_data_buf = arrow_data.values(); let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - let len = end - start; - if arrow_data_buf.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_buf.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + let len = end - start; + if arrow_data_buf.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_buf.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = - unsafe { arrow_data_buf.clone().sliced_unchecked(start, len) }; - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = arrow_data_buf.slice_with_length(start, len); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| { - res_or_opt.map(|v| { - crate::testing::datatypes::StringComponent( - ::re_types_core::ArrowString::from(v), - ) + .map(|res_or_opt| { + res_or_opt.map(|res_or_opt| { + res_or_opt.map(|v| { + crate::testing::datatypes::StringComponent( + ::re_types_core::ArrowString::from(v), + ) + }) }) }) - }) - .collect::>>>() - .with_context("rerun.testing.datatypes.AffixFuzzer20#s")? - .into_iter() + .collect::>>>() + .with_context("rerun.testing.datatypes.AffixFuzzer20#s")? + .into_iter() } }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - ::itertools::izip!(p, s), - arrow_data.validity(), - ) - .map(|opt| { - opt.map(|(p, s)| { - Ok(Self { - p: p.ok_or_else(DeserializationError::missing_data) - .with_context("rerun.testing.datatypes.AffixFuzzer20#p")?, - s: s.ok_or_else(DeserializationError::missing_data) - .with_context("rerun.testing.datatypes.AffixFuzzer20#s")?, + ZipValidity::new_with_validity(::itertools::izip!(p, s), arrow_data.nulls()) + .map(|opt| { + opt.map(|(p, s)| { + Ok(Self { + p: p.ok_or_else(DeserializationError::missing_data) + .with_context("rerun.testing.datatypes.AffixFuzzer20#p")?, + s: s.ok_or_else(DeserializationError::missing_data) + .with_context("rerun.testing.datatypes.AffixFuzzer20#s")?, + }) }) + .transpose() }) - .transpose() - }) - .collect::>>() - .with_context("rerun.testing.datatypes.AffixFuzzer20")? + .collect::>>() + .with_context("rerun.testing.datatypes.AffixFuzzer20")? } }) } diff --git a/crates/store/re_types/src/testing/datatypes/affix_fuzzer21.rs b/crates/store/re_types/src/testing/datatypes/affix_fuzzer21.rs index aa6cac91defd..2254f383640a 100644 --- a/crates/store/re_types/src/testing/datatypes/affix_fuzzer21.rs +++ b/crates/store/re_types/src/testing/datatypes/affix_fuzzer21.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -148,20 +148,19 @@ impl ::re_types_core::Loggable for AffixFuzzer21 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -172,10 +171,10 @@ impl ::re_types_core::Loggable for AffixFuzzer21 { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let single_half = { @@ -197,7 +196,6 @@ impl ::re_types_core::Loggable for AffixFuzzer21 { }) .with_context("rerun.testing.datatypes.AffixFuzzer21#single_half")? .into_iter() - .map(|opt| opt.copied()) }; let many_halves = { if !arrays_by_name.contains_key("many_halves") { @@ -211,7 +209,7 @@ impl ::re_types_core::Loggable for AffixFuzzer21 { { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", @@ -241,40 +239,34 @@ impl ::re_types_core::Loggable for AffixFuzzer21 { .values() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { - arrow_data_inner - .clone() - .sliced_unchecked(start, end - start) - }; - let data = ::re_types_core::ArrowBuffer::from(data); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + arrow_data_inner.clone().slice(start, end - start); + let data = ::re_types_core::ArrowBuffer::from(data); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( ::itertools::izip!(single_half, many_halves), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|opt| { opt.map(|(single_half, many_halves)| { diff --git a/crates/store/re_types/src/testing/datatypes/affix_fuzzer22.rs b/crates/store/re_types/src/testing/datatypes/affix_fuzzer22.rs index 1edab45a0dd6..243c0ed32498 100644 --- a/crates/store/re_types/src/testing/datatypes/affix_fuzzer22.rs +++ b/crates/store/re_types/src/testing/datatypes/affix_fuzzer22.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -124,20 +124,19 @@ impl ::re_types_core::Loggable for AffixFuzzer22 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -148,10 +147,10 @@ impl ::re_types_core::Loggable for AffixFuzzer22 { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let fixed_sized_native = { @@ -166,7 +165,7 @@ impl ::re_types_core::Loggable for AffixFuzzer22 { { let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::FixedSizeList( std::sync::Arc::new(Field::new("item", DataType::UInt8, false)), @@ -198,42 +197,39 @@ impl ::re_types_core::Loggable for AffixFuzzer22 { "rerun.testing.datatypes.AffixFuzzer22#fixed_sized_native", )? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets, - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|(start, end): (usize, usize)| { - debug_assert!(end - start == 4usize); - if end > arrow_data_inner.len() { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets, arrow_data.nulls()) + .map(|elem| { + elem.map(|(start, end): (usize, usize)| { + debug_assert!(end - start == 4usize); + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = - unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data.iter().cloned().map(Option::unwrap_or_default); + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = + data.iter().cloned().map(Option::unwrap_or_default); - // NOTE: Unwrapping cannot fail: the length must be correct. - #[allow(clippy::unwrap_used)] - Ok(array_init::from_iter(data).unwrap()) + // NOTE: Unwrapping cannot fail: the length must be correct. + #[allow(clippy::unwrap_used)] + Ok(array_init::from_iter(data).unwrap()) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( ::itertools::izip!(fixed_sized_native), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|opt| { opt.map(|(fixed_sized_native)| { diff --git a/crates/store/re_types/src/testing/datatypes/affix_fuzzer3.rs b/crates/store/re_types/src/testing/datatypes/affix_fuzzer3.rs index b43ce063aba7..1fd3f209a687 100644 --- a/crates/store/re_types/src/testing/datatypes/affix_fuzzer3.rs +++ b/crates/store/re_types/src/testing/datatypes/affix_fuzzer3.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -247,20 +247,19 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -270,8 +269,7 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { if arrow_data.is_empty() { Vec::new() } else { - let (arrow_data_types, arrow_data_arrays) = - (arrow_data.types(), arrow_data.fields()); + let arrow_data_type_ids = arrow_data.type_ids(); let arrow_data_offsets = arrow_data .offsets() .ok_or_else(|| { @@ -280,18 +278,18 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { DeserializationError::datatype_mismatch(expected, actual) }) .with_context("rerun.testing.datatypes.AffixFuzzer3")?; - if arrow_data_types.len() != arrow_data_offsets.len() { + if arrow_data_type_ids.len() != arrow_data_offsets.len() { return Err(DeserializationError::offset_slice_oob( - (0, arrow_data_types.len()), + (0, arrow_data_type_ids.len()), arrow_data_offsets.len(), )) .with_context("rerun.testing.datatypes.AffixFuzzer3"); } let degrees = { - if arrow_data_arrays.len() <= 1 { + if arrow_data.type_ids().inner().len() <= 1 { return Ok(Vec::new()); } - let arrow_data = &*arrow_data_arrays[1]; + let arrow_data = arrow_data.child(1).as_ref(); arrow_data .as_any() .downcast_ref::() @@ -302,18 +300,17 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { }) .with_context("rerun.testing.datatypes.AffixFuzzer3#degrees")? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; let craziness = { - if arrow_data_arrays.len() <= 2 { + if arrow_data.type_ids().inner().len() <= 2 { return Ok(Vec::new()); } - let arrow_data = &*arrow_data_arrays[2]; + let arrow_data = arrow_data.child(2).as_ref(); { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", @@ -329,7 +326,7 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { } else { let arrow_data_inner = { let arrow_data_inner = &**arrow_data.values(); - crate::testing::datatypes::AffixFuzzer1::from_arrow2_opt( + crate::testing::datatypes::AffixFuzzer1::from_arrow_opt( arrow_data_inner, ) .with_context("rerun.testing.datatypes.AffixFuzzer3#craziness")? @@ -337,48 +334,45 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { .collect::>() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = - unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data - .iter() - .cloned() - .map(Option::unwrap_or_default) - .collect(); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data + .iter() + .cloned() + .map(Option::unwrap_or_default) + .collect(); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } .collect::>() }; let fixed_size_shenanigans = { - if arrow_data_arrays.len() <= 3 { + if arrow_data.type_ids().inner().len() <= 3 { return Ok(Vec::new()); } - let arrow_data = &*arrow_data_arrays[3]; + let arrow_data = arrow_data.child(3).as_ref(); { let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::FixedSizeList( std::sync::Arc::new( @@ -412,18 +406,14 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { "rerun.testing.datatypes.AffixFuzzer3#fixed_size_shenanigans", )? .into_iter() - .map(|opt| opt.copied()) .collect::>() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets, - arrow_data.validity(), - ) + ZipValidity::new_with_validity(offsets, arrow_data.nulls()) .map(|elem| { elem .map(|(start, end): (usize, usize)| { debug_assert!(end - start == 3usize); - if end > arrow_data_inner.len() { + if arrow_data_inner.len() < end { return Err( DeserializationError::offset_slice_oob( (start, end), @@ -453,7 +443,7 @@ impl ::re_types_core::Loggable for AffixFuzzer3 { } .collect::>() }; - arrow_data_types + arrow_data_type_ids .iter() .enumerate() .map(|(i, typ)| { diff --git a/crates/store/re_types/src/testing/datatypes/affix_fuzzer4.rs b/crates/store/re_types/src/testing/datatypes/affix_fuzzer4.rs index bc763821d865..02ff34211f58 100644 --- a/crates/store/re_types/src/testing/datatypes/affix_fuzzer4.rs +++ b/crates/store/re_types/src/testing/datatypes/affix_fuzzer4.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -188,20 +188,19 @@ impl ::re_types_core::Loggable for AffixFuzzer4 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -211,8 +210,7 @@ impl ::re_types_core::Loggable for AffixFuzzer4 { if arrow_data.is_empty() { Vec::new() } else { - let (arrow_data_types, arrow_data_arrays) = - (arrow_data.types(), arrow_data.fields()); + let arrow_data_type_ids = arrow_data.type_ids(); let arrow_data_offsets = arrow_data .offsets() .ok_or_else(|| { @@ -221,32 +219,32 @@ impl ::re_types_core::Loggable for AffixFuzzer4 { DeserializationError::datatype_mismatch(expected, actual) }) .with_context("rerun.testing.datatypes.AffixFuzzer4")?; - if arrow_data_types.len() != arrow_data_offsets.len() { + if arrow_data_type_ids.len() != arrow_data_offsets.len() { return Err(DeserializationError::offset_slice_oob( - (0, arrow_data_types.len()), + (0, arrow_data_type_ids.len()), arrow_data_offsets.len(), )) .with_context("rerun.testing.datatypes.AffixFuzzer4"); } let single_required = { - if arrow_data_arrays.len() <= 1 { + if arrow_data.type_ids().inner().len() <= 1 { return Ok(Vec::new()); } - let arrow_data = &*arrow_data_arrays[1]; - crate::testing::datatypes::AffixFuzzer3::from_arrow2_opt(arrow_data) + let arrow_data = arrow_data.child(1).as_ref(); + crate::testing::datatypes::AffixFuzzer3::from_arrow_opt(arrow_data) .with_context("rerun.testing.datatypes.AffixFuzzer4#single_required")? .into_iter() .collect::>() }; let many_required = { - if arrow_data_arrays.len() <= 2 { + if arrow_data.type_ids().inner().len() <= 2 { return Ok(Vec::new()); } - let arrow_data = &*arrow_data_arrays[2]; + let arrow_data = arrow_data.child(2).as_ref(); { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::List(std::sync::Arc::new(Field::new( "item", @@ -262,7 +260,7 @@ impl ::re_types_core::Loggable for AffixFuzzer4 { } else { let arrow_data_inner = { let arrow_data_inner = &**arrow_data.values(); - crate::testing::datatypes::AffixFuzzer3::from_arrow2_opt( + crate::testing::datatypes::AffixFuzzer3::from_arrow_opt( arrow_data_inner, ) .with_context("rerun.testing.datatypes.AffixFuzzer4#many_required")? @@ -270,40 +268,37 @@ impl ::re_types_core::Loggable for AffixFuzzer4 { .collect::>() }; let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - if arrow_data_inner.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + if arrow_data_inner.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = - unsafe { arrow_data_inner.get_unchecked(start..end) }; - let data = data - .iter() - .cloned() - .map(Option::unwrap_or_default) - .collect(); - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = + unsafe { arrow_data_inner.get_unchecked(start..end) }; + let data = data + .iter() + .cloned() + .map(Option::unwrap_or_default) + .collect(); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .collect::>>>()? + .collect::>>>()? } .into_iter() } .collect::>() }; - arrow_data_types + arrow_data_type_ids .iter() .enumerate() .map(|(i, typ)| { diff --git a/crates/store/re_types/src/testing/datatypes/affix_fuzzer5.rs b/crates/store/re_types/src/testing/datatypes/affix_fuzzer5.rs index 7eff68520d75..eade5824724d 100644 --- a/crates/store/re_types/src/testing/datatypes/affix_fuzzer5.rs +++ b/crates/store/re_types/src/testing/datatypes/affix_fuzzer5.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -93,20 +93,19 @@ impl ::re_types_core::Loggable for AffixFuzzer5 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -117,10 +116,10 @@ impl ::re_types_core::Loggable for AffixFuzzer5 { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let single_optional_union = { @@ -132,13 +131,13 @@ impl ::re_types_core::Loggable for AffixFuzzer5 { .with_context("rerun.testing.datatypes.AffixFuzzer5"); } let arrow_data = &**arrays_by_name["single_optional_union"]; - crate::testing::datatypes::AffixFuzzer4::from_arrow2_opt(arrow_data) + crate::testing::datatypes::AffixFuzzer4::from_arrow_opt(arrow_data) .with_context("rerun.testing.datatypes.AffixFuzzer5#single_optional_union")? .into_iter() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( ::itertools::izip!(single_optional_union), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|opt| { opt.map(|(single_optional_union)| { diff --git a/crates/store/re_types/src/testing/datatypes/enum_test.rs b/crates/store/re_types/src/testing/datatypes/enum_test.rs index b0cab6ff3021..a4645b1cbd34 100644 --- a/crates/store/re_types/src/testing/datatypes/enum_test.rs +++ b/crates/store/re_types/src/testing/datatypes/enum_test.rs @@ -13,7 +13,7 @@ #![allow(clippy::too_many_lines)] #![allow(non_camel_case_types)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -88,16 +88,15 @@ impl ::re_types_core::Loggable for EnumTest { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -108,7 +107,6 @@ impl ::re_types_core::Loggable for EnumTest { }) .with_context("rerun.testing.datatypes.EnumTest#enum")? .into_iter() - .map(|opt| opt.copied()) .map(|typ| match typ { Some(1) => Ok(Some(Self::Up)), Some(2) => Ok(Some(Self::Down)), diff --git a/crates/store/re_types/src/testing/datatypes/flattened_scalar.rs b/crates/store/re_types/src/testing/datatypes/flattened_scalar.rs index 596b7a54dc9a..eb51d2dfbd24 100644 --- a/crates/store/re_types/src/testing/datatypes/flattened_scalar.rs +++ b/crates/store/re_types/src/testing/datatypes/flattened_scalar.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -89,20 +89,19 @@ impl ::re_types_core::Loggable for FlattenedScalar { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -113,10 +112,10 @@ impl ::re_types_core::Loggable for FlattenedScalar { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let value = { @@ -138,24 +137,22 @@ impl ::re_types_core::Loggable for FlattenedScalar { }) .with_context("rerun.testing.datatypes.FlattenedScalar#value")? .into_iter() - .map(|opt| opt.copied()) }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - ::itertools::izip!(value), - arrow_data.validity(), - ) - .map(|opt| { - opt.map(|(value)| { - Ok(Self { - value: value - .ok_or_else(DeserializationError::missing_data) - .with_context("rerun.testing.datatypes.FlattenedScalar#value")?, + ZipValidity::new_with_validity(::itertools::izip!(value), arrow_data.nulls()) + .map(|opt| { + opt.map(|(value)| { + Ok(Self { + value: value + .ok_or_else(DeserializationError::missing_data) + .with_context( + "rerun.testing.datatypes.FlattenedScalar#value", + )?, + }) }) + .transpose() }) - .transpose() - }) - .collect::>>() - .with_context("rerun.testing.datatypes.FlattenedScalar")? + .collect::>>() + .with_context("rerun.testing.datatypes.FlattenedScalar")? } }) } diff --git a/crates/store/re_types/src/testing/datatypes/multi_enum.rs b/crates/store/re_types/src/testing/datatypes/multi_enum.rs index 0551435fa8da..5f618bbf7360 100644 --- a/crates/store/re_types/src/testing/datatypes/multi_enum.rs +++ b/crates/store/re_types/src/testing/datatypes/multi_enum.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -126,20 +126,19 @@ impl ::re_types_core::Loggable for MultiEnum { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -150,10 +149,10 @@ impl ::re_types_core::Loggable for MultiEnum { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let value1 = { @@ -165,7 +164,7 @@ impl ::re_types_core::Loggable for MultiEnum { .with_context("rerun.testing.datatypes.MultiEnum"); } let arrow_data = &**arrays_by_name["value1"]; - crate::testing::datatypes::EnumTest::from_arrow2_opt(arrow_data) + crate::testing::datatypes::EnumTest::from_arrow_opt(arrow_data) .with_context("rerun.testing.datatypes.MultiEnum#value1")? .into_iter() }; @@ -178,13 +177,13 @@ impl ::re_types_core::Loggable for MultiEnum { .with_context("rerun.testing.datatypes.MultiEnum"); } let arrow_data = &**arrays_by_name["value2"]; - crate::testing::datatypes::ValuedEnum::from_arrow2_opt(arrow_data) + crate::testing::datatypes::ValuedEnum::from_arrow_opt(arrow_data) .with_context("rerun.testing.datatypes.MultiEnum#value2")? .into_iter() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( ::itertools::izip!(value1, value2), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|opt| { opt.map(|(value1, value2)| { diff --git a/crates/store/re_types/src/testing/datatypes/primitive_component.rs b/crates/store/re_types/src/testing/datatypes/primitive_component.rs index 2271cc2e2c7c..3d71af9b42d0 100644 --- a/crates/store/re_types/src/testing/datatypes/primitive_component.rs +++ b/crates/store/re_types/src/testing/datatypes/primitive_component.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -67,16 +67,15 @@ impl ::re_types_core::Loggable for PrimitiveComponent { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -87,7 +86,6 @@ impl ::re_types_core::Loggable for PrimitiveComponent { }) .with_context("rerun.testing.datatypes.PrimitiveComponent#value")? .into_iter() - .map(|opt| opt.copied()) .map(|v| v.ok_or_else(DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) .collect::>>>() @@ -96,16 +94,15 @@ impl ::re_types_core::Loggable for PrimitiveComponent { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -120,7 +117,7 @@ impl ::re_types_core::Loggable for PrimitiveComponent { }) .with_context("rerun.testing.datatypes.PrimitiveComponent#value")? .values() - .as_slice(); + .as_ref(); { slice.iter().copied().map(Self).collect::>() } diff --git a/crates/store/re_types/src/testing/datatypes/string_component.rs b/crates/store/re_types/src/testing/datatypes/string_component.rs index 735ff75abb84..ccf90e43aee8 100644 --- a/crates/store/re_types/src/testing/datatypes/string_component.rs +++ b/crates/store/re_types/src/testing/datatypes/string_component.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -75,20 +75,19 @@ impl ::re_types_core::Loggable for StringComponent { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -97,35 +96,32 @@ impl ::re_types_core::Loggable for StringComponent { .with_context("rerun.testing.datatypes.StringComponent#value")?; let arrow_data_buf = arrow_data.values(); let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - let len = end - start; - if arrow_data_buf.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_buf.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + let len = end - start; + if arrow_data_buf.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_buf.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_buf.clone().sliced_unchecked(start, len) }; - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = arrow_data_buf.slice_with_length(start, len); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt - .map(|res_or_opt| res_or_opt.map(|v| ::re_types_core::ArrowString::from(v))) - }) - .collect::>>>() - .with_context("rerun.testing.datatypes.StringComponent#value")? - .into_iter() + .map(|res_or_opt| { + res_or_opt + .map(|res_or_opt| res_or_opt.map(|v| ::re_types_core::ArrowString::from(v))) + }) + .collect::>>>() + .with_context("rerun.testing.datatypes.StringComponent#value")? + .into_iter() } .map(|v| v.ok_or_else(DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) diff --git a/crates/store/re_types/src/testing/datatypes/valued_enum.rs b/crates/store/re_types/src/testing/datatypes/valued_enum.rs index 90aeab7fbdb4..ef4e150411a2 100644 --- a/crates/store/re_types/src/testing/datatypes/valued_enum.rs +++ b/crates/store/re_types/src/testing/datatypes/valued_enum.rs @@ -13,7 +13,7 @@ #![allow(clippy::too_many_lines)] #![allow(non_camel_case_types)] -use ::re_types_core::external::arrow2; +use ::re_types_core::external::arrow; use ::re_types_core::SerializationResult; use ::re_types_core::{ComponentBatch, ComponentBatchCowWithDescriptor}; use ::re_types_core::{ComponentDescriptor, ComponentName}; @@ -81,16 +81,15 @@ impl ::re_types_core::Loggable for ValuedEnum { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use ::re_types_core::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use ::re_types_core::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -101,7 +100,6 @@ impl ::re_types_core::Loggable for ValuedEnum { }) .with_context("rerun.testing.datatypes.ValuedEnum#enum")? .into_iter() - .map(|opt| opt.copied()) .map(|typ| match typ { Some(1) => Ok(Some(Self::One)), Some(2) => Ok(Some(Self::Two)), diff --git a/crates/store/re_types_core/src/archetypes/clear.rs b/crates/store/re_types_core/src/archetypes/clear.rs index 019572ddf0ae..caf656e2a178 100644 --- a/crates/store/re_types_core/src/archetypes/clear.rs +++ b/crates/store/re_types_core/src/archetypes/clear.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use crate::external::arrow2; +use crate::external::arrow; use crate::SerializationResult; use crate::{ComponentBatch, ComponentBatchCowWithDescriptor}; use crate::{ComponentDescriptor, ComponentName}; @@ -163,8 +163,8 @@ impl crate::Archetype for Clear { } #[inline] - fn from_arrow2_components( - arrow_data: impl IntoIterator)>, + fn from_arrow_components( + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use crate::{Loggable as _, ResultExt as _}; @@ -177,7 +177,7 @@ impl crate::Archetype for Clear { .get("rerun.components.ClearIsRecursive") .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Clear#is_recursive")?; - ::from_arrow2_opt(&**array) + ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Clear#is_recursive")? .into_iter() .next() diff --git a/crates/store/re_types_core/src/components/clear_is_recursive.rs b/crates/store/re_types_core/src/components/clear_is_recursive.rs index 1f14d48d8a12..627cbe0fe74b 100644 --- a/crates/store/re_types_core/src/components/clear_is_recursive.rs +++ b/crates/store/re_types_core/src/components/clear_is_recursive.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use crate::external::arrow2; +use crate::external::arrow; use crate::SerializationResult; use crate::{ComponentBatch, ComponentBatchCowWithDescriptor}; use crate::{ComponentDescriptor, ComponentName}; @@ -54,13 +54,13 @@ impl crate::Loggable for ClearIsRecursive { })) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { - crate::datatypes::Bool::from_arrow2_opt(arrow_data) + crate::datatypes::Bool::from_arrow_opt(arrow_data) .map(|v| v.into_iter().map(|v| v.map(Self)).collect()) } } diff --git a/crates/store/re_types_core/src/datatypes/bool.rs b/crates/store/re_types_core/src/datatypes/bool.rs index 1d9abe40b882..c4377d33df2b 100644 --- a/crates/store/re_types_core/src/datatypes/bool.rs +++ b/crates/store/re_types_core/src/datatypes/bool.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use crate::external::arrow2; +use crate::external::arrow; use crate::SerializationResult; use crate::{ComponentBatch, ComponentBatchCowWithDescriptor}; use crate::{ComponentDescriptor, ComponentName}; @@ -68,16 +68,15 @@ impl crate::Loggable for Bool { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use crate::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use crate::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() diff --git a/crates/store/re_types_core/src/datatypes/entity_path.rs b/crates/store/re_types_core/src/datatypes/entity_path.rs index 52690454d531..58af47e2587b 100644 --- a/crates/store/re_types_core/src/datatypes/entity_path.rs +++ b/crates/store/re_types_core/src/datatypes/entity_path.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use crate::external::arrow2; +use crate::external::arrow; use crate::SerializationResult; use crate::{ComponentBatch, ComponentBatchCowWithDescriptor}; use crate::{ComponentDescriptor, ComponentName}; @@ -76,20 +76,19 @@ impl crate::Loggable for EntityPath { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use crate::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use crate::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -98,34 +97,31 @@ impl crate::Loggable for EntityPath { .with_context("rerun.datatypes.EntityPath#path")?; let arrow_data_buf = arrow_data.values(); let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - let len = end - start; - if arrow_data_buf.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_buf.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + let len = end - start; + if arrow_data_buf.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_buf.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_buf.clone().sliced_unchecked(start, len) }; - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = arrow_data_buf.slice_with_length(start, len); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| res_or_opt.map(|v| crate::ArrowString::from(v))) - }) - .collect::>>>() - .with_context("rerun.datatypes.EntityPath#path")? - .into_iter() + .map(|res_or_opt| { + res_or_opt.map(|res_or_opt| res_or_opt.map(|v| crate::ArrowString::from(v))) + }) + .collect::>>>() + .with_context("rerun.datatypes.EntityPath#path")? + .into_iter() } .map(|v| v.ok_or_else(DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) diff --git a/crates/store/re_types_core/src/datatypes/float32.rs b/crates/store/re_types_core/src/datatypes/float32.rs index 194c3fd0fe1d..02fede38a435 100644 --- a/crates/store/re_types_core/src/datatypes/float32.rs +++ b/crates/store/re_types_core/src/datatypes/float32.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use crate::external::arrow2; +use crate::external::arrow; use crate::SerializationResult; use crate::{ComponentBatch, ComponentBatchCowWithDescriptor}; use crate::{ComponentDescriptor, ComponentName}; @@ -68,16 +68,15 @@ impl crate::Loggable for Float32 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use crate::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use crate::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -88,7 +87,6 @@ impl crate::Loggable for Float32 { }) .with_context("rerun.datatypes.Float32#value")? .into_iter() - .map(|opt| opt.copied()) .map(|v| v.ok_or_else(DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) .collect::>>>() @@ -97,16 +95,15 @@ impl crate::Loggable for Float32 { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use crate::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use crate::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -121,7 +118,7 @@ impl crate::Loggable for Float32 { }) .with_context("rerun.datatypes.Float32#value")? .values() - .as_slice(); + .as_ref(); { slice.iter().copied().map(Self).collect::>() } diff --git a/crates/store/re_types_core/src/datatypes/float64.rs b/crates/store/re_types_core/src/datatypes/float64.rs index c83beb229b67..ec4c1dfa6aee 100644 --- a/crates/store/re_types_core/src/datatypes/float64.rs +++ b/crates/store/re_types_core/src/datatypes/float64.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use crate::external::arrow2; +use crate::external::arrow; use crate::SerializationResult; use crate::{ComponentBatch, ComponentBatchCowWithDescriptor}; use crate::{ComponentDescriptor, ComponentName}; @@ -68,16 +68,15 @@ impl crate::Loggable for Float64 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use crate::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use crate::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -88,7 +87,6 @@ impl crate::Loggable for Float64 { }) .with_context("rerun.datatypes.Float64#value")? .into_iter() - .map(|opt| opt.copied()) .map(|v| v.ok_or_else(DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) .collect::>>>() @@ -97,16 +95,15 @@ impl crate::Loggable for Float64 { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use crate::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use crate::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -121,7 +118,7 @@ impl crate::Loggable for Float64 { }) .with_context("rerun.datatypes.Float64#value")? .values() - .as_slice(); + .as_ref(); { slice.iter().copied().map(Self).collect::>() } diff --git a/crates/store/re_types_core/src/datatypes/time_int.rs b/crates/store/re_types_core/src/datatypes/time_int.rs index 9235eff61fe6..8b6830241d81 100644 --- a/crates/store/re_types_core/src/datatypes/time_int.rs +++ b/crates/store/re_types_core/src/datatypes/time_int.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use crate::external::arrow2; +use crate::external::arrow; use crate::SerializationResult; use crate::{ComponentBatch, ComponentBatchCowWithDescriptor}; use crate::{ComponentDescriptor, ComponentName}; @@ -67,16 +67,15 @@ impl crate::Loggable for TimeInt { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use crate::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use crate::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -87,7 +86,6 @@ impl crate::Loggable for TimeInt { }) .with_context("rerun.datatypes.TimeInt#value")? .into_iter() - .map(|opt| opt.copied()) .map(|v| v.ok_or_else(DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) .collect::>>>() @@ -96,16 +94,15 @@ impl crate::Loggable for TimeInt { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use crate::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use crate::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -120,7 +117,7 @@ impl crate::Loggable for TimeInt { }) .with_context("rerun.datatypes.TimeInt#value")? .values() - .as_slice(); + .as_ref(); { slice.iter().copied().map(Self).collect::>() } diff --git a/crates/store/re_types_core/src/datatypes/time_range.rs b/crates/store/re_types_core/src/datatypes/time_range.rs index 770c206fea6e..4dc96fcc0e4e 100644 --- a/crates/store/re_types_core/src/datatypes/time_range.rs +++ b/crates/store/re_types_core/src/datatypes/time_range.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use crate::external::arrow2; +use crate::external::arrow; use crate::SerializationResult; use crate::{ComponentBatch, ComponentBatchCowWithDescriptor}; use crate::{ComponentDescriptor, ComponentName}; @@ -126,20 +126,19 @@ impl crate::Loggable for TimeRange { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use crate::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use crate::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -150,10 +149,10 @@ impl crate::Loggable for TimeRange { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let start = { @@ -165,7 +164,7 @@ impl crate::Loggable for TimeRange { .with_context("rerun.datatypes.TimeRange"); } let arrow_data = &**arrays_by_name["start"]; - crate::datatypes::TimeRangeBoundary::from_arrow2_opt(arrow_data) + crate::datatypes::TimeRangeBoundary::from_arrow_opt(arrow_data) .with_context("rerun.datatypes.TimeRange#start")? .into_iter() }; @@ -178,29 +177,26 @@ impl crate::Loggable for TimeRange { .with_context("rerun.datatypes.TimeRange"); } let arrow_data = &**arrays_by_name["end"]; - crate::datatypes::TimeRangeBoundary::from_arrow2_opt(arrow_data) + crate::datatypes::TimeRangeBoundary::from_arrow_opt(arrow_data) .with_context("rerun.datatypes.TimeRange#end")? .into_iter() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( - ::itertools::izip!(start, end), - arrow_data.validity(), - ) - .map(|opt| { - opt.map(|(start, end)| { - Ok(Self { - start: start - .ok_or_else(DeserializationError::missing_data) - .with_context("rerun.datatypes.TimeRange#start")?, - end: end - .ok_or_else(DeserializationError::missing_data) - .with_context("rerun.datatypes.TimeRange#end")?, + ZipValidity::new_with_validity(::itertools::izip!(start, end), arrow_data.nulls()) + .map(|opt| { + opt.map(|(start, end)| { + Ok(Self { + start: start + .ok_or_else(DeserializationError::missing_data) + .with_context("rerun.datatypes.TimeRange#start")?, + end: end + .ok_or_else(DeserializationError::missing_data) + .with_context("rerun.datatypes.TimeRange#end")?, + }) }) + .transpose() }) - .transpose() - }) - .collect::>>() - .with_context("rerun.datatypes.TimeRange")? + .collect::>>() + .with_context("rerun.datatypes.TimeRange")? } }) } diff --git a/crates/store/re_types_core/src/datatypes/time_range_boundary.rs b/crates/store/re_types_core/src/datatypes/time_range_boundary.rs index 92b12ba1ca91..339e76f77f5d 100644 --- a/crates/store/re_types_core/src/datatypes/time_range_boundary.rs +++ b/crates/store/re_types_core/src/datatypes/time_range_boundary.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use crate::external::arrow2; +use crate::external::arrow; use crate::SerializationResult; use crate::{ComponentBatch, ComponentBatchCowWithDescriptor}; use crate::{ComponentDescriptor, ComponentName}; @@ -190,20 +190,19 @@ impl crate::Loggable for TimeRangeBoundary { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use crate::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use crate::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -213,8 +212,7 @@ impl crate::Loggable for TimeRangeBoundary { if arrow_data.is_empty() { Vec::new() } else { - let (arrow_data_types, arrow_data_arrays) = - (arrow_data.types(), arrow_data.fields()); + let arrow_data_type_ids = arrow_data.type_ids(); let arrow_data_offsets = arrow_data .offsets() .ok_or_else(|| { @@ -223,18 +221,18 @@ impl crate::Loggable for TimeRangeBoundary { DeserializationError::datatype_mismatch(expected, actual) }) .with_context("rerun.datatypes.TimeRangeBoundary")?; - if arrow_data_types.len() != arrow_data_offsets.len() { + if arrow_data_type_ids.len() != arrow_data_offsets.len() { return Err(DeserializationError::offset_slice_oob( - (0, arrow_data_types.len()), + (0, arrow_data_type_ids.len()), arrow_data_offsets.len(), )) .with_context("rerun.datatypes.TimeRangeBoundary"); } let cursor_relative = { - if arrow_data_arrays.len() <= 1 { + if arrow_data.type_ids().inner().len() <= 1 { return Ok(Vec::new()); } - let arrow_data = &*arrow_data_arrays[1]; + let arrow_data = arrow_data.child(1).as_ref(); arrow_data .as_any() .downcast_ref::() @@ -245,15 +243,14 @@ impl crate::Loggable for TimeRangeBoundary { }) .with_context("rerun.datatypes.TimeRangeBoundary#CursorRelative")? .into_iter() - .map(|opt| opt.copied()) .map(|res_or_opt| res_or_opt.map(crate::datatypes::TimeInt)) .collect::>() }; let absolute = { - if arrow_data_arrays.len() <= 2 { + if arrow_data.type_ids().inner().len() <= 2 { return Ok(Vec::new()); } - let arrow_data = &*arrow_data_arrays[2]; + let arrow_data = arrow_data.child(2).as_ref(); arrow_data .as_any() .downcast_ref::() @@ -264,11 +261,10 @@ impl crate::Loggable for TimeRangeBoundary { }) .with_context("rerun.datatypes.TimeRangeBoundary#Absolute")? .into_iter() - .map(|opt| opt.copied()) .map(|res_or_opt| res_or_opt.map(crate::datatypes::TimeInt)) .collect::>() }; - arrow_data_types + arrow_data_type_ids .iter() .enumerate() .map(|(i, typ)| { diff --git a/crates/store/re_types_core/src/datatypes/uint16.rs b/crates/store/re_types_core/src/datatypes/uint16.rs index 5320d9777e41..9a7b539a6991 100644 --- a/crates/store/re_types_core/src/datatypes/uint16.rs +++ b/crates/store/re_types_core/src/datatypes/uint16.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use crate::external::arrow2; +use crate::external::arrow; use crate::SerializationResult; use crate::{ComponentBatch, ComponentBatchCowWithDescriptor}; use crate::{ComponentDescriptor, ComponentName}; @@ -67,16 +67,15 @@ impl crate::Loggable for UInt16 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use crate::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use crate::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -87,7 +86,6 @@ impl crate::Loggable for UInt16 { }) .with_context("rerun.datatypes.UInt16#value")? .into_iter() - .map(|opt| opt.copied()) .map(|v| v.ok_or_else(DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) .collect::>>>() @@ -96,16 +94,15 @@ impl crate::Loggable for UInt16 { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use crate::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use crate::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -120,7 +117,7 @@ impl crate::Loggable for UInt16 { }) .with_context("rerun.datatypes.UInt16#value")? .values() - .as_slice(); + .as_ref(); { slice.iter().copied().map(Self).collect::>() } diff --git a/crates/store/re_types_core/src/datatypes/uint32.rs b/crates/store/re_types_core/src/datatypes/uint32.rs index 0c11c36b0c8b..88871d1b7e80 100644 --- a/crates/store/re_types_core/src/datatypes/uint32.rs +++ b/crates/store/re_types_core/src/datatypes/uint32.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use crate::external::arrow2; +use crate::external::arrow; use crate::SerializationResult; use crate::{ComponentBatch, ComponentBatchCowWithDescriptor}; use crate::{ComponentDescriptor, ComponentName}; @@ -67,16 +67,15 @@ impl crate::Loggable for UInt32 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use crate::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use crate::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -87,7 +86,6 @@ impl crate::Loggable for UInt32 { }) .with_context("rerun.datatypes.UInt32#value")? .into_iter() - .map(|opt| opt.copied()) .map(|v| v.ok_or_else(DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) .collect::>>>() @@ -96,16 +94,15 @@ impl crate::Loggable for UInt32 { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use crate::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use crate::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -120,7 +117,7 @@ impl crate::Loggable for UInt32 { }) .with_context("rerun.datatypes.UInt32#value")? .values() - .as_slice(); + .as_ref(); { slice.iter().copied().map(Self).collect::>() } diff --git a/crates/store/re_types_core/src/datatypes/uint64.rs b/crates/store/re_types_core/src/datatypes/uint64.rs index 4a78e89ee499..68eedd0288ab 100644 --- a/crates/store/re_types_core/src/datatypes/uint64.rs +++ b/crates/store/re_types_core/src/datatypes/uint64.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use crate::external::arrow2; +use crate::external::arrow; use crate::SerializationResult; use crate::{ComponentBatch, ComponentBatchCowWithDescriptor}; use crate::{ComponentDescriptor, ComponentName}; @@ -67,16 +67,15 @@ impl crate::Loggable for UInt64 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use crate::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use crate::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok(arrow_data .as_any() .downcast_ref::() @@ -87,7 +86,6 @@ impl crate::Loggable for UInt64 { }) .with_context("rerun.datatypes.UInt64#value")? .into_iter() - .map(|opt| opt.copied()) .map(|v| v.ok_or_else(DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) .collect::>>>() @@ -96,16 +94,15 @@ impl crate::Loggable for UInt64 { } #[inline] - fn from_arrow2(arrow_data: &dyn arrow2::array::Array) -> DeserializationResult> + fn from_arrow(arrow_data: &dyn arrow::array::Array) -> DeserializationResult> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use crate::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; - if let Some(validity) = arrow_data.validity() { - if validity.unset_bits() != 0 { + use crate::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; + if let Some(nulls) = arrow_data.nulls() { + if nulls.null_count() != 0 { return Err(DeserializationError::missing_data()); } } @@ -120,7 +117,7 @@ impl crate::Loggable for UInt64 { }) .with_context("rerun.datatypes.UInt64#value")? .values() - .as_slice(); + .as_ref(); { slice.iter().copied().map(Self).collect::>() } diff --git a/crates/store/re_types_core/src/datatypes/utf8.rs b/crates/store/re_types_core/src/datatypes/utf8.rs index 79e3fe46b16e..58fbe452071c 100644 --- a/crates/store/re_types_core/src/datatypes/utf8.rs +++ b/crates/store/re_types_core/src/datatypes/utf8.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use crate::external::arrow2; +use crate::external::arrow; use crate::SerializationResult; use crate::{ComponentBatch, ComponentBatchCowWithDescriptor}; use crate::{ComponentDescriptor, ComponentName}; @@ -76,20 +76,19 @@ impl crate::Loggable for Utf8 { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use crate::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use crate::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -98,34 +97,31 @@ impl crate::Loggable for Utf8 { .with_context("rerun.datatypes.Utf8#value")?; let arrow_data_buf = arrow_data.values(); let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - let len = end - start; - if arrow_data_buf.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_buf.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + let len = end - start; + if arrow_data_buf.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_buf.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = unsafe { arrow_data_buf.clone().sliced_unchecked(start, len) }; - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = arrow_data_buf.slice_with_length(start, len); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| res_or_opt.map(|v| crate::ArrowString::from(v))) - }) - .collect::>>>() - .with_context("rerun.datatypes.Utf8#value")? - .into_iter() + .map(|res_or_opt| { + res_or_opt.map(|res_or_opt| res_or_opt.map(|v| crate::ArrowString::from(v))) + }) + .collect::>>>() + .with_context("rerun.datatypes.Utf8#value")? + .into_iter() } .map(|v| v.ok_or_else(DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) diff --git a/crates/store/re_types_core/src/datatypes/visible_time_range.rs b/crates/store/re_types_core/src/datatypes/visible_time_range.rs index 91e470e85a07..2079c5cef426 100644 --- a/crates/store/re_types_core/src/datatypes/visible_time_range.rs +++ b/crates/store/re_types_core/src/datatypes/visible_time_range.rs @@ -12,7 +12,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_lines)] -use crate::external::arrow2; +use crate::external::arrow; use crate::SerializationResult; use crate::{ComponentBatch, ComponentBatchCowWithDescriptor}; use crate::{ComponentDescriptor, ComponentName}; @@ -138,20 +138,19 @@ impl crate::Loggable for VisibleTimeRange { }) } - fn from_arrow2_opt( - arrow_data: &dyn arrow2::array::Array, + fn from_arrow_opt( + arrow_data: &dyn arrow::array::Array, ) -> DeserializationResult>> where Self: Sized, { #![allow(clippy::wildcard_imports)] - use crate::{Loggable as _, ResultExt as _}; - use arrow::datatypes::*; - use arrow2::{array::*, buffer::*}; + use crate::{arrow_zip_validity::ZipValidity, Loggable as _, ResultExt as _}; + use arrow::{array::*, buffer::*, datatypes::*}; Ok({ let arrow_data = arrow_data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or_else(|| { let expected = Self::arrow_datatype(); let actual = arrow_data.data_type().clone(); @@ -162,10 +161,10 @@ impl crate::Loggable for VisibleTimeRange { Vec::new() } else { let (arrow_data_fields, arrow_data_arrays) = - (arrow_data.fields(), arrow_data.values()); + (arrow_data.fields(), arrow_data.columns()); let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data_fields .iter() - .map(|field| field.name.as_str()) + .map(|field| field.name().as_str()) .zip(arrow_data_arrays) .collect(); let timeline = { @@ -180,7 +179,7 @@ impl crate::Loggable for VisibleTimeRange { { let arrow_data = arrow_data .as_any() - .downcast_ref::>() + .downcast_ref::() .ok_or_else(|| { let expected = DataType::Utf8; let actual = arrow_data.data_type().clone(); @@ -189,38 +188,35 @@ impl crate::Loggable for VisibleTimeRange { .with_context("rerun.datatypes.VisibleTimeRange#timeline")?; let arrow_data_buf = arrow_data.values(); let offsets = arrow_data.offsets(); - arrow2::bitmap::utils::ZipValidity::new_with_validity( - offsets.windows(2), - arrow_data.validity(), - ) - .map(|elem| { - elem.map(|window| { - let start = window[0] as usize; - let end = window[1] as usize; - let len = end - start; - if arrow_data_buf.len() < end { - return Err(DeserializationError::offset_slice_oob( - (start, end), - arrow_data_buf.len(), - )); - } + ZipValidity::new_with_validity(offsets.windows(2), arrow_data.nulls()) + .map(|elem| { + elem.map(|window| { + let start = window[0] as usize; + let end = window[1] as usize; + let len = end - start; + if arrow_data_buf.len() < end { + return Err(DeserializationError::offset_slice_oob( + (start, end), + arrow_data_buf.len(), + )); + } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] - let data = - unsafe { arrow_data_buf.clone().sliced_unchecked(start, len) }; - Ok(data) + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] + let data = arrow_data_buf.slice_with_length(start, len); + Ok(data) + }) + .transpose() }) - .transpose() - }) - .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| { - res_or_opt - .map(|v| crate::datatypes::Utf8(crate::ArrowString::from(v))) + .map(|res_or_opt| { + res_or_opt.map(|res_or_opt| { + res_or_opt.map(|v| { + crate::datatypes::Utf8(crate::ArrowString::from(v)) + }) + }) }) - }) - .collect::>>>() - .with_context("rerun.datatypes.VisibleTimeRange#timeline")? - .into_iter() + .collect::>>>() + .with_context("rerun.datatypes.VisibleTimeRange#timeline")? + .into_iter() } }; let range = { @@ -232,13 +228,13 @@ impl crate::Loggable for VisibleTimeRange { .with_context("rerun.datatypes.VisibleTimeRange"); } let arrow_data = &**arrays_by_name["range"]; - crate::datatypes::TimeRange::from_arrow2_opt(arrow_data) + crate::datatypes::TimeRange::from_arrow_opt(arrow_data) .with_context("rerun.datatypes.VisibleTimeRange#range")? .into_iter() }; - arrow2::bitmap::utils::ZipValidity::new_with_validity( + ZipValidity::new_with_validity( ::itertools::izip!(timeline, range), - arrow_data.validity(), + arrow_data.nulls(), ) .map(|opt| { opt.map(|(timeline, range)| { From 3e792d2576275a26ef7eac6ce298ac40e8bcf86b Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Wed, 18 Dec 2024 16:35:10 +0100 Subject: [PATCH 4/5] Add TODO:s for calling unsafe slice functions --- .../build/re_types_builder/src/codegen/rust/deserializer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/build/re_types_builder/src/codegen/rust/deserializer.rs b/crates/build/re_types_builder/src/codegen/rust/deserializer.rs index 45fe4925e0f1..9208b5902f69 100644 --- a/crates/build/re_types_builder/src/codegen/rust/deserializer.rs +++ b/crates/build/re_types_builder/src/codegen/rust/deserializer.rs @@ -597,7 +597,7 @@ fn quote_arrow_field_deserializer( (start, end), #data_src_buf.len(), )); } - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] // TODO: unsafe slice again + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] // TODO(apache/arrow-rs#6900): slice_with_length_unchecked unsafe when https://github.com/apache/arrow-rs/pull/6901 is merged and released let data = #data_src_buf.slice_with_length(start, len); Ok(data) @@ -749,7 +749,7 @@ fn quote_arrow_field_deserializer( let quoted_inner_data_range = match inner_repr { InnerRepr::BufferT => { quote! { - #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] // TODO: unsafe + #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] // TODO(apache/arrow-rs#6900): unsafe slice_unchecked when https://github.com/apache/arrow-rs/pull/6901 is merged and released let data = #data_src_inner.clone().slice(start, end - start); let data = ::re_types_core::ArrowBuffer::from(data); } From 10d58b6edc505af4fe25e82e7a94dd7767b7c2e9 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Wed, 18 Dec 2024 17:14:53 +0100 Subject: [PATCH 5/5] Convert example components to arrow-rs --- Cargo.lock | 1 + crates/store/re_log_types/Cargo.toml | 1 + .../re_log_types/src/example_components.rs | 180 ++++++++++-------- 3 files changed, 102 insertions(+), 80 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 60076725fe56..e420be7e5591 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6014,6 +6014,7 @@ version = "0.21.0-alpha.1+dev" dependencies = [ "ahash", "anyhow", + "arrow", "backtrace", "bytemuck", "clean-path", diff --git a/crates/store/re_log_types/Cargo.toml b/crates/store/re_log_types/Cargo.toml index 58c67788ff93..e61e5f78ea76 100644 --- a/crates/store/re_log_types/Cargo.toml +++ b/crates/store/re_log_types/Cargo.toml @@ -55,6 +55,7 @@ re_types_core.workspace = true # External ahash.workspace = true anyhow.workspace = true +arrow.workspace = true arrow2 = { workspace = true, features = [ "io_ipc", "io_print", diff --git a/crates/store/re_log_types/src/example_components.rs b/crates/store/re_log_types/src/example_components.rs index 5ee3df3a3a81..247c5041af63 100644 --- a/crates/store/re_log_types/src/example_components.rs +++ b/crates/store/re_log_types/src/example_components.rs @@ -75,20 +75,22 @@ impl SizeBytes for MyPoint { } impl Loggable for MyPoint { - fn arrow2_datatype() -> arrow2::datatypes::DataType { - use arrow2::datatypes::DataType::Float32; - arrow2::datatypes::DataType::Struct(Arc::new(vec![ - arrow2::datatypes::Field::new("x", Float32, false), - arrow2::datatypes::Field::new("y", Float32, false), + fn arrow_datatype() -> arrow::datatypes::DataType { + use arrow::datatypes::DataType::Float32; + arrow::datatypes::DataType::Struct(arrow::datatypes::Fields::from(vec![ + arrow::datatypes::Field::new("x", Float32, false), + arrow::datatypes::Field::new("y", Float32, false), ])) } - fn to_arrow2_opt<'a>( + fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> re_types_core::SerializationResult> + ) -> re_types_core::SerializationResult where Self: 'a, { + use arrow::datatypes::DataType::Float32; + let (xs, ys): (Vec<_>, Vec<_>) = data .into_iter() .map(Option::unwrap) @@ -96,47 +98,55 @@ impl Loggable for MyPoint { .map(|p| (p.x, p.y)) .unzip(); - let x_array = arrow2::array::Float32Array::from_vec(xs).boxed(); - let y_array = arrow2::array::Float32Array::from_vec(ys).boxed(); + let x_array = Arc::new(arrow::array::Float32Array::from(xs)); + let y_array = Arc::new(arrow::array::Float32Array::from(ys)); - Ok( - arrow2::array::StructArray::new(Self::arrow2_datatype(), vec![x_array, y_array], None) - .boxed(), - ) + Ok(Arc::new(arrow::array::StructArray::new( + arrow::datatypes::Fields::from(vec![ + arrow::datatypes::Field::new("x", Float32, false), + arrow::datatypes::Field::new("y", Float32, false), + ]), + vec![x_array, y_array], + None, + ))) } - fn from_arrow2_opt( - data: &dyn arrow2::array::Array, + fn from_arrow_opt( + data: &dyn arrow::array::Array, ) -> re_types_core::DeserializationResult>> { let array = data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or(DeserializationError::downcast_error::< - arrow2::array::StructArray, + arrow::array::StructArray, >())?; - let x_array = array.values()[0].as_ref(); - let y_array = array.values()[1].as_ref(); + let x_array = array.columns()[0].as_ref(); + let y_array = array.columns()[1].as_ref(); let xs = x_array .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or(DeserializationError::downcast_error::< - arrow2::array::Float32Array, + arrow::array::Float32Array, >())?; let ys = y_array .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or(DeserializationError::downcast_error::< - arrow2::array::Float32Array, + arrow::array::Float32Array, >())?; Ok(xs - .values_iter() - .copied() - .zip(ys.values_iter().copied()) - .map(|(x, y)| Self { x, y }) - .map(Some) + .iter() + .zip(ys.iter()) + .map(|(x, y)| { + if let (Some(x), Some(y)) = (x, y) { + Some(Self { x, y }) + } else { + None + } + }) .collect()) } } @@ -184,20 +194,22 @@ impl SizeBytes for MyPoint64 { } impl Loggable for MyPoint64 { - fn arrow2_datatype() -> arrow2::datatypes::DataType { - use arrow2::datatypes::DataType::Float64; - arrow2::datatypes::DataType::Struct(Arc::new(vec![ - arrow2::datatypes::Field::new("x", Float64, false), - arrow2::datatypes::Field::new("y", Float64, false), + fn arrow_datatype() -> arrow::datatypes::DataType { + use arrow::datatypes::DataType::Float64; + arrow::datatypes::DataType::Struct(arrow::datatypes::Fields::from(vec![ + arrow::datatypes::Field::new("x", Float64, false), + arrow::datatypes::Field::new("y", Float64, false), ])) } - fn to_arrow2_opt<'a>( + fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> re_types_core::SerializationResult> + ) -> re_types_core::SerializationResult where Self: 'a, { + use arrow::datatypes::DataType::Float64; + let (xs, ys): (Vec<_>, Vec<_>) = data .into_iter() .map(Option::unwrap) @@ -205,47 +217,55 @@ impl Loggable for MyPoint64 { .map(|p| (p.x, p.y)) .unzip(); - let x_array = arrow2::array::Float64Array::from_vec(xs).boxed(); - let y_array = arrow2::array::Float64Array::from_vec(ys).boxed(); + let x_array = Arc::new(arrow::array::Float64Array::from(xs)); + let y_array = Arc::new(arrow::array::Float64Array::from(ys)); - Ok( - arrow2::array::StructArray::new(Self::arrow2_datatype(), vec![x_array, y_array], None) - .boxed(), - ) + Ok(Arc::new(arrow::array::StructArray::new( + arrow::datatypes::Fields::from(vec![ + arrow::datatypes::Field::new("x", Float64, false), + arrow::datatypes::Field::new("y", Float64, false), + ]), + vec![x_array, y_array], + None, + ))) } - fn from_arrow2_opt( - data: &dyn arrow2::array::Array, + fn from_arrow_opt( + data: &dyn arrow::array::Array, ) -> re_types_core::DeserializationResult>> { let array = data .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or(DeserializationError::downcast_error::< - arrow2::array::StructArray, + arrow::array::StructArray, >())?; - let x_array = array.values()[0].as_ref(); - let y_array = array.values()[1].as_ref(); + let x_array = array.columns()[0].as_ref(); + let y_array = array.columns()[1].as_ref(); let xs = x_array .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or(DeserializationError::downcast_error::< - arrow2::array::Float64Array, + arrow::array::Float64Array, >())?; let ys = y_array .as_any() - .downcast_ref::() + .downcast_ref::() .ok_or(DeserializationError::downcast_error::< - arrow2::array::Float64Array, + arrow::array::Float64Array, >())?; Ok(xs - .values_iter() - .copied() - .zip(ys.values_iter().copied()) - .map(|(x, y)| Self { x, y }) - .map(Some) + .iter() + .zip(ys.iter()) + .map(|(x, y)| { + if let (Some(x), Some(y)) = (x, y) { + Some(Self { x, y }) + } else { + None + } + }) .collect()) } } @@ -296,28 +316,28 @@ impl SizeBytes for MyColor { } impl Loggable for MyColor { - fn arrow2_datatype() -> arrow2::datatypes::DataType { - arrow2::datatypes::DataType::UInt32 + fn arrow_datatype() -> arrow::datatypes::DataType { + arrow::datatypes::DataType::UInt32 } - fn to_arrow2_opt<'a>( + fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> re_types_core::SerializationResult> + ) -> re_types_core::SerializationResult where Self: 'a, { use re_types_core::datatypes::UInt32; - UInt32::to_arrow2_opt( + UInt32::to_arrow_opt( data.into_iter() .map(|opt| opt.map(Into::into).map(|c| UInt32(c.0))), ) } - fn from_arrow2_opt( - data: &dyn arrow2::array::Array, + fn from_arrow_opt( + data: &dyn arrow::array::Array, ) -> re_types_core::DeserializationResult>> { use re_types_core::datatypes::UInt32; - Ok(UInt32::from_arrow2_opt(data)? + Ok(UInt32::from_arrow_opt(data)? .into_iter() .map(|opt| opt.map(|v| Self(v.0))) .collect()) @@ -347,28 +367,28 @@ impl SizeBytes for MyLabel { } impl Loggable for MyLabel { - fn arrow2_datatype() -> arrow2::datatypes::DataType { - re_types_core::datatypes::Utf8::arrow2_datatype() + fn arrow_datatype() -> arrow::datatypes::DataType { + re_types_core::datatypes::Utf8::arrow_datatype() } - fn to_arrow2_opt<'a>( + fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> re_types_core::SerializationResult> + ) -> re_types_core::SerializationResult where Self: 'a, { use re_types_core::datatypes::Utf8; - Utf8::to_arrow2_opt( + Utf8::to_arrow_opt( data.into_iter() .map(|opt| opt.map(Into::into).map(|l| Utf8(l.0.clone().into()))), ) } - fn from_arrow2_opt( - data: &dyn arrow2::array::Array, + fn from_arrow_opt( + data: &dyn arrow::array::Array, ) -> re_types_core::DeserializationResult>> { use re_types_core::datatypes::Utf8; - Ok(Utf8::from_arrow2_opt(data)? + Ok(Utf8::from_arrow_opt(data)? .into_iter() .map(|opt| opt.map(|v| Self(v.0.to_string()))) .collect()) @@ -407,28 +427,28 @@ impl SizeBytes for MyIndex { } impl Loggable for MyIndex { - fn arrow2_datatype() -> arrow2::datatypes::DataType { - arrow2::datatypes::DataType::UInt64 + fn arrow_datatype() -> arrow::datatypes::DataType { + arrow::datatypes::DataType::UInt64 } - fn to_arrow2_opt<'a>( + fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> re_types_core::SerializationResult> + ) -> re_types_core::SerializationResult where Self: 'a, { use re_types_core::datatypes::UInt64; - UInt64::to_arrow2_opt( + UInt64::to_arrow_opt( data.into_iter() .map(|opt| opt.map(Into::into).map(|c| UInt64(c.0))), ) } - fn from_arrow2_opt( - data: &dyn arrow2::array::Array, + fn from_arrow_opt( + data: &dyn arrow::array::Array, ) -> re_types_core::DeserializationResult>> { use re_types_core::datatypes::UInt64; - Ok(UInt64::from_arrow2_opt(data)? + Ok(UInt64::from_arrow_opt(data)? .into_iter() .map(|opt| opt.map(|v| Self(v.0))) .collect())