Skip to content

Commit 8ca16b1

Browse files
authored
Reenable tagging (#8500)
Title. * DNM: requires 0.21 released first
1 parent 81b5e8d commit 8ca16b1

File tree

8 files changed

+22
-115
lines changed

8 files changed

+22
-115
lines changed

crates/store/re_chunk/src/chunk.rs

-28
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ impl ChunkComponents {
6868
component_desc: ComponentDescriptor,
6969
list_array: ArrowListArray,
7070
) -> Option<ArrowListArray> {
71-
// TODO(cmc): revert me
72-
let component_desc = component_desc.untagged();
7371
self.0
7472
.entry(component_desc.component_name)
7573
.or_default()
@@ -391,32 +389,6 @@ impl Chunk {
391389
self
392390
}
393391

394-
/// Clones the chunk into a new chunk where all descriptors are untagged.
395-
///
396-
/// Only useful as a migration tool while the Rerun ecosystem slowly moves over
397-
/// to always using tags for everything.
398-
#[doc(hidden)]
399-
#[inline]
400-
pub fn clone_as_untagged(&self) -> Self {
401-
let mut chunk = self.clone();
402-
403-
let per_component_name = &mut chunk.components;
404-
for (component_name, per_desc) in per_component_name.iter_mut() {
405-
if per_desc.len() != 1 {
406-
// If there are more than one entry, then we're in the land of UB anyway (for now).
407-
continue;
408-
}
409-
410-
let untagged_descriptor = ComponentDescriptor::new(*component_name);
411-
*per_desc = std::mem::take(per_desc)
412-
.into_values()
413-
.map(|list_array| (untagged_descriptor.clone(), list_array))
414-
.collect();
415-
}
416-
417-
chunk
418-
}
419-
420392
/// Clones the chunk into a new chunk where all [`RowId`]s are [`RowId::ZERO`].
421393
pub fn zeroed(self) -> Self {
422394
let row_ids = std::iter::repeat(RowId::ZERO)

crates/store/re_chunk_store/src/writes.rs

-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ impl ChunkStore {
6363
// * Etc.
6464
if self.id.kind == re_log_types::StoreKind::Blueprint {
6565
let patched = chunk.patched_for_blueprint_021_compat();
66-
let patched = patched.clone_as_untagged();
6766
chunk = Arc::new(patched);
6867
}
6968

crates/store/re_types_core/src/component_descriptor.rs

-4
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,6 @@ impl ComponentDescriptor {
142142
}
143143
}
144144

145-
pub fn untagged(self) -> Self {
146-
Self::new(self.component_name)
147-
}
148-
149145
/// Unconditionally sets [`Self::archetype_name`] to the given one.
150146
#[inline]
151147
pub fn with_archetype_name(mut self, archetype_name: ArchetypeName) -> Self {

docs/snippets/all/descriptors/descr_builtin_archetype.rs

+4-22
Original file line numberDiff line numberDiff line change
@@ -56,38 +56,20 @@ fn check_tags(rec: &rerun::RecordingStream) {
5656
.collect::<Vec<_>>();
5757
descriptors.sort();
5858

59-
// TODO(cmc): revert me
60-
// let expected = vec![
61-
// ComponentDescriptor {
62-
// archetype_name: None,
63-
// archetype_field_name: None,
64-
// component_name: "rerun.components.Points3DIndicator".into(),
65-
// },
66-
// ComponentDescriptor {
67-
// archetype_name: Some("rerun.archetypes.Points3D".into()),
68-
// archetype_field_name: Some("positions".into()),
69-
// component_name: "rerun.components.Position3D".into(),
70-
// },
71-
// ComponentDescriptor {
72-
// archetype_name: Some("rerun.archetypes.Points3D".into()),
73-
// archetype_field_name: Some("radii".into()),
74-
// component_name: "rerun.components.Radius".into(),
75-
// },
76-
// ];
7759
let expected = vec![
7860
ComponentDescriptor {
7961
archetype_name: None,
8062
archetype_field_name: None,
8163
component_name: "rerun.components.Points3DIndicator".into(),
8264
},
8365
ComponentDescriptor {
84-
archetype_name: None,
85-
archetype_field_name: None,
66+
archetype_name: Some("rerun.archetypes.Points3D".into()),
67+
archetype_field_name: Some("positions".into()),
8668
component_name: "rerun.components.Position3D".into(),
8769
},
8870
ComponentDescriptor {
89-
archetype_name: None,
90-
archetype_field_name: None,
71+
archetype_name: Some("rerun.archetypes.Points3D".into()),
72+
archetype_field_name: Some("radii".into()),
9173
component_name: "rerun.components.Radius".into(),
9274
},
9375
];

docs/snippets/all/descriptors/descr_custom_archetype.rs

+6-24
Original file line numberDiff line numberDiff line change
@@ -104,38 +104,20 @@ fn check_tags(rec: &rerun::RecordingStream) {
104104
.collect::<Vec<_>>();
105105
descriptors.sort();
106106

107-
// TODO(cmc): revert me
108-
// let expected = vec![
109-
// ComponentDescriptor {
110-
// archetype_name: None,
111-
// archetype_field_name: None,
112-
// component_name: "user.CustomPoints3DIndicator".into(),
113-
// },
114-
// ComponentDescriptor {
115-
// archetype_name: Some("user.CustomPoints3D".into()),
116-
// archetype_field_name: Some("colors".into()),
117-
// component_name: "rerun.components.Color".into(),
118-
// },
119-
// ComponentDescriptor {
120-
// archetype_name: Some("user.CustomPoints3D".into()),
121-
// archetype_field_name: Some("custom_positions".into()),
122-
// component_name: "user.CustomPosition3D".into(),
123-
// },
124-
// ];
125107
let expected = vec![
126108
ComponentDescriptor {
127109
archetype_name: None,
128110
archetype_field_name: None,
129-
component_name: "rerun.components.Color".into(),
111+
component_name: "user.CustomPoints3DIndicator".into(),
130112
},
131113
ComponentDescriptor {
132-
archetype_name: None,
133-
archetype_field_name: None,
134-
component_name: "user.CustomPoints3DIndicator".into(),
114+
archetype_name: Some("user.CustomPoints3D".into()),
115+
archetype_field_name: Some("colors".into()),
116+
component_name: "rerun.components.Color".into(),
135117
},
136118
ComponentDescriptor {
137-
archetype_name: None,
138-
archetype_field_name: None,
119+
archetype_name: Some("user.CustomPoints3D".into()),
120+
archetype_field_name: Some("custom_positions".into()),
139121
component_name: "user.CustomPosition3D".into(),
140122
},
141123
];

docs/snippets/all/descriptors/descr_custom_component.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,10 @@ fn check_tags(rec: &rerun::RecordingStream) {
6060
.collect::<Vec<_>>();
6161
descriptors.sort();
6262

63-
// TODO(cmc): revert me
64-
// let expected = vec![
65-
// ComponentDescriptor {
66-
// archetype_name: Some("user.CustomArchetype".into()),
67-
// archetype_field_name: Some("custom_positions".into()),
68-
// component_name: "user.CustomPosition3D".into(),
69-
// }, //
70-
// ];
7163
let expected = vec![
7264
ComponentDescriptor {
73-
archetype_name: None,
74-
archetype_field_name: None,
65+
archetype_name: Some("user.CustomArchetype".into()),
66+
archetype_field_name: Some("custom_positions".into()),
7567
component_name: "user.CustomPosition3D".into(),
7668
}, //
7769
];

docs/snippets/snippets.toml

+3
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ quick_start = [ # These examples don't have exactly the same implementation.
231231
"py",
232232
"rust",
233233
]
234+
"archetypes/points3d_partial_updates" = [ # TODO(cmc): revert once C++ has tagged partial updates
235+
"cpp",
236+
]
234237
"archetypes/points3d_random" = [ # TODO(#3206): examples use different RNGs
235238
"cpp",
236239
"py",

rerun_py/tests/unit/test_dataframe.py

+7-26
Original file line numberDiff line numberDiff line change
@@ -104,36 +104,14 @@ def test_schema_recording(self) -> None:
104104
# Color, Points3DIndicator, Position3D, Radius, Text, TextIndicator
105105
assert len(schema.component_columns()) == 6
106106

107-
# TODO(cmc): revert me
108-
# assert schema.index_columns()[0].name == "log_tick"
109-
# assert schema.index_columns()[1].name == "log_time"
110-
# assert schema.index_columns()[2].name == "my_index"
111-
# assert schema.component_columns()[0].entity_path == "/points"
112-
# assert schema.component_columns()[0].component_name == "rerun.components.Points3DIndicator"
113-
# assert schema.component_columns()[0].is_static is False
114-
# assert schema.component_columns()[1].entity_path == "/points"
115-
# assert schema.component_columns()[1].component_name == "rerun.components.Color"
116-
# assert schema.component_columns()[1].is_static is False
117-
# assert schema.component_columns()[2].entity_path == "/points"
118-
# assert schema.component_columns()[2].component_name == "rerun.components.Position3D"
119-
# assert schema.component_columns()[2].is_static is False
120-
# assert schema.component_columns()[3].entity_path == "/points"
121-
# assert schema.component_columns()[3].component_name == "rerun.components.Radius"
122-
# assert schema.component_columns()[3].is_static is False
123-
# assert schema.component_columns()[4].entity_path == "/static_text"
124-
# assert schema.component_columns()[4].component_name == "rerun.components.TextLogIndicator"
125-
# assert schema.component_columns()[4].is_static is True
126-
# assert schema.component_columns()[5].entity_path == "/static_text"
127-
# assert schema.component_columns()[5].component_name == "rerun.components.Text"
128-
# assert schema.component_columns()[5].is_static is True
129107
assert schema.index_columns()[0].name == "log_tick"
130108
assert schema.index_columns()[1].name == "log_time"
131109
assert schema.index_columns()[2].name == "my_index"
132110
assert schema.component_columns()[0].entity_path == "/points"
133-
assert schema.component_columns()[0].component_name == "rerun.components.Color"
111+
assert schema.component_columns()[0].component_name == "rerun.components.Points3DIndicator"
134112
assert schema.component_columns()[0].is_static is False
135113
assert schema.component_columns()[1].entity_path == "/points"
136-
assert schema.component_columns()[1].component_name == "rerun.components.Points3DIndicator"
114+
assert schema.component_columns()[1].component_name == "rerun.components.Color"
137115
assert schema.component_columns()[1].is_static is False
138116
assert schema.component_columns()[2].entity_path == "/points"
139117
assert schema.component_columns()[2].component_name == "rerun.components.Position3D"
@@ -142,11 +120,14 @@ def test_schema_recording(self) -> None:
142120
assert schema.component_columns()[3].component_name == "rerun.components.Radius"
143121
assert schema.component_columns()[3].is_static is False
144122
assert schema.component_columns()[4].entity_path == "/static_text"
145-
assert schema.component_columns()[4].component_name == "rerun.components.Text"
123+
assert schema.component_columns()[4].component_name == "rerun.components.TextLogIndicator"
146124
assert schema.component_columns()[4].is_static is True
147125
assert schema.component_columns()[5].entity_path == "/static_text"
148-
assert schema.component_columns()[5].component_name == "rerun.components.TextLogIndicator"
126+
assert schema.component_columns()[5].component_name == "rerun.components.Text"
149127
assert schema.component_columns()[5].is_static is True
128+
assert schema.index_columns()[0].name == "log_tick"
129+
assert schema.index_columns()[1].name == "log_time"
130+
assert schema.index_columns()[2].name == "my_index"
150131

151132
def test_schema_view(self) -> None:
152133
schema = self.recording.view(index="my_index", contents="points").schema()

0 commit comments

Comments
 (0)