Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused Loggable::extended_arrow_datatype #7260

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions crates/store/re_types_core/src/loggable.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::sync::Arc;

use crate::{
result::_Backtrace, DeserializationResult, ResultExt as _, SerializationResult, SizeBytes,
};
Expand Down Expand Up @@ -41,21 +39,6 @@ pub trait Loggable: 'static + Send + Sync + Clone + Sized + SizeBytes {
where
Self: 'a;

// --- Optional metadata methods ---

/// The underlying [`arrow2::datatypes::DataType`], including datatype extensions.
///
/// The default implementation will simply wrap [`Self::arrow_datatype`] in an extension called
/// [`Self::name`], which is what you want in most cases.
#[inline]
fn extended_arrow_datatype() -> arrow2::datatypes::DataType {
arrow2::datatypes::DataType::Extension(
Self::name().to_string(),
Arc::new(Self::arrow_datatype()),
None,
)
}

// --- Optional serialization methods ---

/// Given an iterator of owned or reference values to the current [`Loggable`], serializes
Expand Down
8 changes: 7 additions & 1 deletion crates/store/re_types_core/src/tuid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,14 @@ impl Loggable for Tuid {
];
let validity = None;

let datatype = arrow2::datatypes::DataType::Extension(
Self::name().to_string(),
Arc::new(Self::arrow_datatype()),
None,
);

// TODO(cmc): We use the extended type here because we rely on it for formatting.
Ok(StructArray::new(Self::extended_arrow_datatype(), values, validity).boxed())
Ok(StructArray::new(datatype, values, validity).boxed())
}

fn from_arrow(array: &dyn ::arrow2::array::Array) -> crate::DeserializationResult<Vec<Self>> {
Expand Down
Loading