From b329d4ac76c9fe8d6b682e17b152d764cd8ab3eb Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 9 Dec 2024 18:00:32 +0100 Subject: [PATCH] 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 8612d3af76245..6fe71ecce50c3 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 73d077994f4fe..e6c9574b375fb 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 a6cd1074b5c3e..1856f2f47efff 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 e1381ac13f034..1e66dff861f4e 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 6d405894be129..52f6efbb52760 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 8f5e2157db796..9cc7ea795a036 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 e63a42357d975..e0ea1c6831596 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 f0b2d929212e0..ffdaf5f494faa 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 7e5cb90368b73..36d48b2782ac2 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 fcaa8f20b1b75..e1c1a0b4888cb 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 642694071edc7..f6658b6101ad1 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 bc6ee14a53f69..111485b9177ea 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 c415be42a4378..63cf147063b22 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 341616ee2eb36..06b4fb41e095f 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 1051801f5767d..5d109634d4471 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 d30dfea19a76d..42c20574d675a 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 3f3e707e185f8..34968e1a25b38 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 523f260011427..80fb934505258 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 fd99a27f18eac..0f251cb34ddb1 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 657ffd47d1e38..595afb313aeb3 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 3bca90b8753f1..c046ab3c455b1 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 e4a7d8528a092..a1b8c3f2873c9 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 23dc3ee1c7551..d35449361cb47 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 8b8cbf318a533..662d70f8d841d 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 0828e9e0eda4a..8e021288eca1d 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 8bebaac4327a2..d2ab11cb569b8 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 b26145d93c443..5666639343a6c 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 258b7bd9996ca..bf42e18c3a487 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 b77a9c91b18b4..4330a1006dd07 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 54abbdffd86cf..30aae6eba3027 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 06d506570baf9..28de2bb51fcf7 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 c234080942617..3c0c07e6ec182 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 81eeef4990e09..813acd9152dcf 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 e302867c05312..fbb0a08a51e7d 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 4007da4f52f6b..d022dbee1b7d2 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 0b56c276a7e59..f618a6c1775b6 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 2971a46e11509..6c7f40d67170e 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 22044c2a31ed2..afaf462475074 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 5f12962b42dc9..f8d530b4f5dd3 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 9f4536a2b7506..e7c2cccede203 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 f294b0eb98188..f10220eda196e 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 026e249436d4d..ebc69af80fbf7 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 cc74aa2aabf4d..ccf3a6fa9941b 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 3442f7edc6285..d9653c29b657c 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 7efeb6d2a687a..0d988319a55a0 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 d4f68720d2852..3da825443290b 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 9714d55ddff1e..4fc8acbe3136f 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 7f55137e124f6..84b58f482b9b8 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 7c371c5c9a448..62ecd63f035c1 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 a6a75ebc6defb..806b4d56b4856 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 0756e3347a668..2de47b2a4d466 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 422cd47a38d71..b49025d97c0d2 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 8e6bbfd0aa103..e4f17be0efaba 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 2cc4714acc07c..539c27e09131c 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 a748140632bdc..851f7917243da 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 5c75fa92e887f..826c78b47730a 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 8056a916b681c..eb47853697b89 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 e409e5dbd94a2..dfc0918ccaee4 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 36b7359658fc7..1705b356fabde 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 faf8dc094e448..906b555d92e96 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 d4087718ebd88..e9446d5edc98b 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 a25155016fc00..1021d82c97de5 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 64bad27240f12..e844bcaf15d9c 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 635ede9eaadd3..a86aef376aa24 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 f76bd4be51a51..2134d2a9956b2 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 4c3c81c027aeb..6b52735b09793 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 2df6b4e36c599..605f0c548ef58 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 dc258abb03d2c..2c60c877ec7a2 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 5b629bb95e691..c83eca4478f9c 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 5be06c34de17b..c83f8e36db352 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 8a70ffc068f73..cd89e49d629a3 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 d91a043a615f9..363a03072b59b 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 d1efe60bbb4f4..97c79a10c465f 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 6ed979d90197d..3a98909b37cfd 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 4015a22ff8844..b9667fbdad761 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 1cadd10724f06..20e99faec6a40 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 05e3f7ace7f49..fda4f2e449f38 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 db8c730d2c55b..c5e1ef07d93ee 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 7a8e4216ed519..d663a77b5efe2 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 b9caf19b944d2..152c6724fbed3 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 5ed60f06fba7e..7bd06b220e5f4 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 d3684644b5d42..1559679b5ba03 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 be4161f2de22a..d981907d9a958 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 290ee9d7ce58b..5ba786df400cb 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 31d6e0754b29f..0af58e2f22860 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 914bc4e2eca41..d2a1f611a49be 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 efc7f680c876d..3cb94e88c29b6 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 4496488e546b5..370efdde8c39f 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 22d7a8288b1fd..cd7ddfa19d91d 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 013b81cebc554..6afcb839590a1 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 09d16f92615dc..7e5864321de4d 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 be679b705c38f..3488936d0d52c 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 c4322a8dbd587..a1c7a59c36988 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 4f9685db76773..b7510f5b348eb 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 fefb606c8f46d..897ded6af215e 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 99b03d0960a20..df801cd9c3a6e 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 f25a6decb5b2f..bf7f217568cdf 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 dd0694d2ab66a..fefbc52389434 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 c74756eaa46e2..077e37f54a551 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 e747cf1e93f36..677f61a4e744f 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 4bb0cec1fea98..38c9066c1048b 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 fa525e58dee97..aa89140cf5c94 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 1e1d612b53c2d..1e6dea965a344 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 6bee621d477ef..a58f9728e6539 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 0c2cb2b288baf..799bb8fbedf3d 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 3ff1d79abf646..9728259e84f28 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 749234094780d..658cb13bee12d 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 68dce6e28e47b..de7a5def29954 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 8f562935cf37a..d754556f738ec 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 efdf00a552325..c7b9dd7d89a9e 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 ef82928a58c9c..4a7a2c789649a 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 044b5f916b521..2f1a0ac23d0ad 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 fc81295ba79ed..0b530b6a6a39a 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 df61f0eea61c6..f4518e6f0fa10 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 916352c94bd30..fe98ca352477e 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 c24f64f2d2fd8..2b38445f145bb 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 c9c9b7780f145..edbf9ad40ff50 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 d504c0b615375..b8721d80b214b 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 3d566e2b07d7c..84ae0f56abd26 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 a7a7c34e5ed94..fafb78b1aea9f 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 fca2eccdf2d55..c7acce85106a3 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 45706c7b49321..25822212e164a 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 cec09ea9d3186..f3a878790f18e 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 3e745d780a413..08d30f26d1330 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 4c1b63c5fac6c..ed98a3664cc9c 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 62626d83d9edb..13184d78227d4 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 00232aacb8bea..029b694727eca 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 2237888deb1f5..06a3eca316514 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 09348a64d66f2..1fbd8ebe681b8 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 2fb1838a1d5f7..1af7d3001a1b2 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 89480d1e09839..14363ae4bad06 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 6436a08dc0f95..5220e27aa9fae 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 14d5cb88b2063..d87c811030a07 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 998bf7e53ed73..9b93ef637fa16 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 9d1e41bd2f56c..67f0a23d31834 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 2d591a3903d97..ca29cd069279f 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 0ff93ed36d567..ca68618c76c23 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 b8d74796b611e..d0084f5e3ed9b 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 3368b23b8b5ec..3a235f80f955c 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 5ca84903e0462..36e005a9a8554 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 fcac594ffd8e9..5d489bfeb4e9a 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 97e579575bc76..c98f004acbbb1 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 ae48e1ac332c2..c95cf61f1b673 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 2a85ca01bf3fa..e3abad5a30d98 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 a426cc42a1949..57aa17a52cbc3 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 d8fb05969340f..5a9a006930f78 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 c6c0241188a8d..6f878e48d6b98 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 822156726101b..852f53f84770a 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 61e2bb43aa1dc..1214fcfd3e7db 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 3db0606450045..dd9187c60d0e1 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 3aa09bef378b2..1dbe3f0c20fdf 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 964700df594df..8e42ed4bb598f 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 3ef25810010cd..21f2218591993 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 2c2f3b9295f87..d7b3ab784c0e7 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 efde8a24c595f..d8976720a203d 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 94790a01a4f39..2b6da1f6eaf3e 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 6b89098bfa513..b371a0a931b8c 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 06b071e198ff4..3e10e9724a11a 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 0936cd7685de7..42e69b20a86ad 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 4dd0974898308..7ba4be07f3f1d 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 4ac815733c709..04afd9ceeaa6d 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 21dafdc164417..91652da60bf47 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 0ee536178c0b1..c513eaa7ba5a3 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 97e1f3e9384ef..961f0aa868123 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 064c4051c1b5f..86a596368323f 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 949c39f8967c1..c8773e1e8bc2b 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 08093d9fab094..7b49c6fce958e 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 63d7604643e6e..6f480ca76e181 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 6efd104a5685e..a8dc8180b1050 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 e6d43551fb980..8e1cbe641dcda 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 1731d8d779249..3ba8704c4df56 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 ff48187042d3c..67fe8df519fd1 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 eba8cd4c5525a..938ed9cc4afe1 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 991a59b9bb7c3..8c78aa1de2c82 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 fc9671de6afcf..56f5775a4244d 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 4fcd383ef19d0..56717f742e2d9 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 d7875c9c1724f..6fa2f05107bcc 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 1fb197e8c6c02..f141fd191a489 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 9bcd6f464a699..56749f7153043 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 cdefaf8cc1720..1299f5f929953 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 be25aefef481c..e12f584e3dd7f 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 4cfdc64bf2176..f8a44f78fe81a 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 dd66f8d5f4988..7be645aeaa316 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 b74b624fb9f97..f3869f1e139d6 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 2c40d6bf2938f..ec3122380c706 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 06e08627da945..f539ba97a02c5 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 0dc6a7829caf9..58106dfb8f8ac 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 b6827410d9b8a..13ca4e5d524f3 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 075f3b22301f8..cec4a51993144 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 304ace03f214f..bc0e2f531a2a7 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 d7d6414e32dad..4d621c7ed9237 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 f5d8d0040a22b..9d9f61c2b2a3b 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 1ca28125ab112..bde509ba0e808 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 9923b79507561..799a918511812 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 d487773cfe2b9..d944e6468496d 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 920ad38a6f7dc..36e4d8bc841d1 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 45da55ee1117d..d085779f8284e 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 0b7c9aa8301e0..3d956c1afb751 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 7607453c2349b..989d0002475d2 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 dde74d4cd6d86..50e739e26676e 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 991fa76b5501c..72146f7c924c3 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 5451895c339b5..968301ba49c5b 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 8fb26c31b5b68..945c3deab7ab6 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 59218e9ced584..9a43e87ec66e2 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 cf2df863a568e..454032b310cf3 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 4d75cc0c12e33..a064c0bf5dfb0 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 179947448fcb4..0dc09505356f1 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 cbf750d553423..5688961210a55 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 2eec236d76872..11ddfd9ee5409 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 56c95a6893b28..4eb2fae60f505 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 73027ab3b0e3b..a26a270235d8a 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 c2d0688212c75..c78e1830a2f81 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 1f081982fec9c..5b0df05647726 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 a50e5b92d935d..ee211fc6268dc 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 62f096d2e0167..705ddaa76eda9 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 cf04d4da7c205..8d839b335a528 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 b572e278c1cc7..ed171b0a80fb3 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 c290c685fc2b8..a4096775b5e9a 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 8eed4f39795a6..ab4db1f615bd8 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 28cb64bfebc61..64d98e9150b07 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 643d315ff076f..a1a58b8f377ce 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 e3f2d70e7783d..237868f3fe858 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 967ddc99930aa..e4fcef85bf434 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 739d7de755cc0..e0ffb422ee489 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 142b2b88218fa..93c4ebc47b140 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 e3f13d3a9d4b7..e9424fdff051e 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 9118de31e42ae..888b45df6d444 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 9e3e6dd8afdd1..66e1f08852ff4 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 674d8a6eb4cda..c52e0634ed97d 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 605c7831b803e..eb367c26de2af 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 5c3584825e370..54a2b4129ffd5 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 0ee06f26d3824..63349a8e50a42 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 1a5b51bc90699..76c685d9b4bef 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 32e9c765e816c..54ae020357576 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 03d4e6af555b1..4983b0c62bcec 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 1455cba6c48aa..6830da2c82ab4 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 7e74d392baafc..b19f1a95dc62b 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 9ece4182d69c3..7d232fe5098d5 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 3dc4948654aee..5bf77e3943fa3 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 0759fa56d94f8..a25c1f30c1703 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 d86667953fd21..2e8933158ac4d 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 119e829355e77..5788a4af1b337 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 74fa0a201a01f..517ed02143e5c 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 9bbec3a8735ff..0422bf29ef22c 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 a5d0d98442cd4..ecc4bf620d88c 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 4cec3891a6671..f96ee9933c692 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 07e674e03429d..59b6b37dd4e6a 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 36adf314259fd..7b5a77a566617 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 aa6cac91defd8..2254f383640af 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 1edab45a0dd6b..243c0ed32498d 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 b43ce063aba7f..1fd3f209a6877 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 bc763821d8651..02ff34211f581 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 7eff68520d756..eade5824724df 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 b0cab6ff30218..a4645b1cbd34b 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 596b7a54dc9ac..eb51d2dfbd240 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 0551435fa8da5..5f618bbf73603 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 2271cc2e2c7c9..3d71af9b42d09 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 735ff75abb846..ccf90e43aee85 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 90aeab7fbdb42..ef4e150411a2a 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 019572ddf0aec..caf656e2a178c 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 1f14d48d8a12a..627cbe0fe74b6 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 1d9abe40b8823..c4377d33df2ba 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 52690454d5318..58af47e2587b7 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 194c3fd0fe1df..02fede38a435c 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 c83beb229b67b..ec4c1dfa6aee7 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 9235eff61fe63..8b6830241d81f 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 770c206fea6e0..4dc96fcc0e4e2 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 92b12ba1ca915..339e76f77f5d8 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 5320d9777e411..9a7b539a69913 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 0c11c36b0c8b2..88871d1b7e804 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 4a78e89ee499c..68eedd0288abe 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 79e3fe46b16e6..58fbe452071c1 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 91e470e85a07a..2079c5cef4261 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)| {