Skip to content

Commit

Permalink
datatype checking should only apply to logical types until migration …
Browse files Browse the repository at this point in the history
…is over
  • Loading branch information
teh-cmc committed Jul 26, 2023
1 parent 0edf5f1 commit dcc1bd4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 7 additions & 3 deletions crates/re_arrow_store/src/store_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,15 @@ impl DataStore {
use std::collections::hash_map::Entry;
match self.type_registry.entry(cell.component_name()) {
Entry::Occupied(entry) => {
if entry.get() != cell.datatype() {
// NOTE: Don't care about extensions until the migration is over (arrow2-convert
// issues).
let expected = entry.get().to_logical_type().clone();
let got = cell.datatype().to_logical_type().clone();
if expected != got {
return Err(WriteError::TypeCheck {
component: cell.component_name(),
expected: entry.get().clone(),
got: cell.datatype().clone(),
expected,
got,
});
}
}
Expand Down
6 changes: 5 additions & 1 deletion crates/re_data_store/src/store_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,11 @@ fn check_known_component_schemas(msg: &ArrowMsg) {
for actual in &msg.schema.fields {
if let Some(expected) = known_fields.get(actual.name.as_str()) {
if let arrow2::datatypes::DataType::List(actual_field) = &actual.data_type {
if actual_field.data_type != expected.data_type {
// NOTE: Don't care about extensions until the migration is over (arrow2-convert
// issues).
let actual_datatype = actual_field.data_type.to_logical_type();
let expected_datatype = expected.data_type.to_logical_type();
if actual_datatype != expected_datatype {
re_log::warn_once!(
"The incoming component {:?} had the type:\n{:#?}\nExpected type:\n{:#?}",
actual.name,
Expand Down

0 comments on commit dcc1bd4

Please sign in to comment.