@@ -181,7 +181,7 @@ fn generate_object_file(
181
181
182
182
code. push_str ( "\n \n " ) ;
183
183
184
- code. push_str ( "use ::re_types_core::external::arrow2 ;\n " ) ;
184
+ code. push_str ( "use ::re_types_core::external::arrow ;\n " ) ;
185
185
code. push_str ( "use ::re_types_core::SerializationResult;\n " ) ;
186
186
code. push_str ( "use ::re_types_core::{DeserializationResult, DeserializationError};\n " ) ;
187
187
code. push_str ( "use ::re_types_core::{ComponentDescriptor, ComponentName};\n " ) ;
@@ -880,8 +880,8 @@ fn quote_trait_impls_for_datatype_or_component(
880
880
}
881
881
} ;
882
882
883
- let quoted_from_arrow2 = if optimize_for_buffer_slice {
884
- let from_arrow2_body = if let Some ( forwarded_type) = forwarded_type. as_ref ( ) {
883
+ let quoted_from_arrow = if optimize_for_buffer_slice {
884
+ let from_arrow_body = if let Some ( forwarded_type) = forwarded_type. as_ref ( ) {
885
885
let is_pod = obj
886
886
. try_get_attr :: < String > ( ATTR_RUST_DERIVE )
887
887
. map_or ( false , |d| d. contains ( "bytemuck::Pod" ) )
@@ -890,11 +890,11 @@ fn quote_trait_impls_for_datatype_or_component(
890
890
. map_or ( false , |d| d. contains ( "bytemuck::Pod" ) ) ;
891
891
if is_pod {
892
892
quote ! {
893
- #forwarded_type:: from_arrow2 ( arrow_data) . map( bytemuck:: cast_vec)
893
+ #forwarded_type:: from_arrow ( arrow_data) . map( bytemuck:: cast_vec)
894
894
}
895
895
} else {
896
896
quote ! {
897
- #forwarded_type:: from_arrow2 ( arrow_data) . map( |v| v. into_iter( ) . map( Self ) . collect( ) )
897
+ #forwarded_type:: from_arrow ( arrow_data) . map( |v| v. into_iter( ) . map( Self ) . collect( ) )
898
898
}
899
899
}
900
900
} else {
@@ -906,14 +906,13 @@ fn quote_trait_impls_for_datatype_or_component(
906
906
// re_tracing::profile_function!();
907
907
908
908
#![ allow( clippy:: wildcard_imports) ]
909
- use arrow:: datatypes:: * ;
910
- use arrow2:: { array:: * , buffer:: * } ;
911
- use :: re_types_core:: { Loggable as _, ResultExt as _} ;
909
+ use arrow:: { array:: * , buffer:: * , datatypes:: * } ;
910
+ use :: re_types_core:: { arrow_zip_validity:: ZipValidity , Loggable as _, ResultExt as _} ;
912
911
913
- // This code-path cannot have null fields. If it does have a validity mask
914
- // all bits must indicate valid data.
915
- if let Some ( validity ) = arrow_data. validity ( ) {
916
- if validity . unset_bits ( ) != 0 {
912
+ // This code-path cannot have null fields.
913
+ // If it does have a nulls-array, all bits must indicate valid data.
914
+ if let Some ( nulls ) = arrow_data. nulls ( ) {
915
+ if nulls . null_count ( ) != 0 {
917
916
return Err ( DeserializationError :: missing_data( ) ) ;
918
917
}
919
918
}
@@ -924,13 +923,13 @@ fn quote_trait_impls_for_datatype_or_component(
924
923
925
924
quote ! {
926
925
#[ inline]
927
- fn from_arrow2 (
928
- arrow_data: & dyn arrow2 :: array:: Array ,
926
+ fn from_arrow (
927
+ arrow_data: & dyn arrow :: array:: Array ,
929
928
) -> DeserializationResult <Vec <Self >>
930
929
where
931
930
Self : Sized
932
931
{
933
- #from_arrow2_body
932
+ #from_arrow_body
934
933
}
935
934
}
936
935
} else {
@@ -940,7 +939,7 @@ fn quote_trait_impls_for_datatype_or_component(
940
939
// Forward deserialization to existing datatype if it's transparent.
941
940
let quoted_deserializer = if let Some ( forwarded_type) = forwarded_type. as_ref ( ) {
942
941
quote ! {
943
- #forwarded_type:: from_arrow2_opt ( arrow_data) . map( |v| v. into_iter( ) . map( |v| v. map( Self ) ) . collect( ) )
942
+ #forwarded_type:: from_arrow_opt ( arrow_data) . map( |v| v. into_iter( ) . map( |v| v. map( Self ) ) . collect( ) )
944
943
}
945
944
} else {
946
945
let quoted_deserializer = quote_arrow_deserializer ( arrow_registry, objects, obj) ;
@@ -949,9 +948,9 @@ fn quote_trait_impls_for_datatype_or_component(
949
948
// re_tracing::profile_function!();
950
949
951
950
#![ allow( clippy:: wildcard_imports) ]
952
- use arrow:: datatypes:: * ;
953
- use arrow2 :: { array :: * , buffer :: * } ;
954
- use :: re_types_core :: { Loggable as _ , ResultExt as _ } ;
951
+ use arrow:: { array :: * , buffer :: * , datatypes:: * } ;
952
+ use :: re_types_core :: { arrow_zip_validity :: ZipValidity , Loggable as _ , ResultExt as _ } ;
953
+
955
954
Ok ( #quoted_deserializer)
956
955
}
957
956
} ;
@@ -1019,16 +1018,16 @@ fn quote_trait_impls_for_datatype_or_component(
1019
1018
#quoted_serializer
1020
1019
1021
1020
// NOTE: Don't inline this, this gets _huge_.
1022
- fn from_arrow2_opt (
1023
- arrow_data: & dyn arrow2 :: array:: Array ,
1021
+ fn from_arrow_opt (
1022
+ arrow_data: & dyn arrow :: array:: Array ,
1024
1023
) -> DeserializationResult <Vec <Option <Self >>>
1025
1024
where
1026
1025
Self : Sized
1027
1026
{
1028
1027
#quoted_deserializer
1029
1028
}
1030
1029
1031
- #quoted_from_arrow2
1030
+ #quoted_from_arrow
1032
1031
}
1033
1032
}
1034
1033
}
@@ -1227,7 +1226,7 @@ fn quote_trait_impls_for_archetype(obj: &Object) -> TokenStream {
1227
1226
1228
1227
quote ! {
1229
1228
if let Some ( array) = arrays_by_name. get( #field_typ_fqname_str) {
1230
- <#component>:: from_arrow2_opt ( & * * array)
1229
+ <#component>:: from_arrow_opt ( & * * array)
1231
1230
. with_context( #obj_field_fqname) ?
1232
1231
#quoted_collection
1233
1232
} else {
@@ -1238,7 +1237,7 @@ fn quote_trait_impls_for_archetype(obj: &Object) -> TokenStream {
1238
1237
quote ! {
1239
1238
if let Some ( array) = arrays_by_name. get( #field_typ_fqname_str) {
1240
1239
Some ( {
1241
- <#component>:: from_arrow2_opt ( & * * array)
1240
+ <#component>:: from_arrow_opt ( & * * array)
1242
1241
. with_context( #obj_field_fqname) ?
1243
1242
#quoted_collection
1244
1243
} )
@@ -1253,7 +1252,7 @@ fn quote_trait_impls_for_archetype(obj: &Object) -> TokenStream {
1253
1252
. ok_or_else( DeserializationError :: missing_data)
1254
1253
. with_context( #obj_field_fqname) ?;
1255
1254
1256
- <#component>:: from_arrow2_opt ( & * * array) . with_context( #obj_field_fqname) ? #quoted_collection
1255
+ <#component>:: from_arrow_opt ( & * * array) . with_context( #obj_field_fqname) ? #quoted_collection
1257
1256
} }
1258
1257
} ;
1259
1258
@@ -1323,10 +1322,10 @@ fn quote_trait_impls_for_archetype(obj: &Object) -> TokenStream {
1323
1322
}
1324
1323
1325
1324
#[ inline]
1326
- fn from_arrow2_components (
1325
+ fn from_arrow_components (
1327
1326
arrow_data: impl IntoIterator <Item = (
1328
1327
ComponentName ,
1329
- Box <dyn arrow2 :: array:: Array > ,
1328
+ arrow :: array:: ArrayRef ,
1330
1329
) >,
1331
1330
) -> DeserializationResult <Self > {
1332
1331
re_tracing:: profile_function!( ) ;
0 commit comments