Skip to content

Commit 2d1b386

Browse files
authored
Fix scalar loading for LeRobot (#9957)
1 parent 04dad8c commit 2d1b386

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

crates/store/re_data_loader/src/loader_lerobot.rs

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
1-
use std::sync::Arc;
2-
use std::sync::mpsc::Sender;
3-
use std::thread;
1+
use std::{
2+
sync::{Arc, mpsc::Sender},
3+
thread,
4+
};
45

56
use anyhow::{Context as _, anyhow};
6-
use arrow::array::{
7-
ArrayRef, BinaryArray, FixedSizeListArray, Int64Array, RecordBatch, StringArray, StructArray,
7+
use arrow::{
8+
array::{
9+
ArrayRef, BinaryArray, FixedSizeListArray, Int64Array, RecordBatch, StringArray,
10+
StructArray,
11+
},
12+
compute::cast,
13+
datatypes::{DataType, Field},
814
};
9-
use arrow::compute::cast;
10-
use arrow::datatypes::{DataType, Field};
1115
use itertools::Either;
16+
1217
use re_arrow_util::ArrowArrayDowncastRef as _;
1318
use re_chunk::{
1419
ArrowArray, Chunk, ChunkId, EntityPath, RowId, TimeColumn, TimeInt, TimePoint, Timeline,
20+
TimelineName, external::nohash_hasher::IntMap,
1521
};
16-
use re_chunk::{TimelineName, external::nohash_hasher::IntMap};
17-
1822
use re_log_types::{ApplicationId, StoreId};
19-
use re_types::archetypes::{
20-
AssetVideo, DepthImage, EncodedImage, TextDocument, VideoFrameReference,
23+
use re_types::{
24+
Archetype, Component, ComponentBatch,
25+
archetypes::{
26+
AssetVideo, DepthImage, EncodedImage, Scalars, TextDocument, VideoFrameReference,
27+
},
28+
components::{Name, VideoTimestamp},
2129
};
22-
use re_types::components::{Name, Scalar, VideoTimestamp};
23-
use re_types::{Archetype, Component, ComponentBatch};
2430

2531
use crate::lerobot::{
2632
DType, EpisodeIndex, Feature, LeRobotDataset, TaskIndex, is_lerobot_dataset,
@@ -592,11 +598,7 @@ fn make_scalar_entity_chunk(
592598
ChunkId::new(),
593599
entity_path,
594600
timelines.clone(),
595-
std::iter::once((
596-
<Scalar as Component>::descriptor().clone(),
597-
data_field_array,
598-
))
599-
.collect(),
601+
std::iter::once((Scalars::descriptor_scalars().clone(), data_field_array)).collect(),
600602
)?)
601603
}
602604

0 commit comments

Comments
 (0)