From 8fe0372785cce78cdda98aabe60f8d7f4a23cbc2 Mon Sep 17 00:00:00 2001 From: Jeremy Leibs Date: Tue, 15 Oct 2024 11:59:50 -0400 Subject: [PATCH] Unit test to verify we can inspect the schema contents --- rerun_py/tests/unit/test_dataframe.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/rerun_py/tests/unit/test_dataframe.py b/rerun_py/tests/unit/test_dataframe.py index 072542d239c9..0f09cdc029d4 100644 --- a/rerun_py/tests/unit/test_dataframe.py +++ b/rerun_py/tests/unit/test_dataframe.py @@ -95,6 +95,23 @@ def test_recording_info(self) -> None: assert self.recording.application_id() == APP_ID assert self.recording.recording_id() == str(RECORDING_ID) + def test_schema(self) -> None: + schema = self.recording.schema() + + assert len(schema.index_columns()) == 3 + # Points3DIndicator, Position3D, Color + assert len(schema.component_columns()) == 3 + + assert schema.index_columns()[0].name == "log_tick" + assert schema.index_columns()[1].name == "log_time" + assert schema.index_columns()[2].name == "my_index" + assert schema.component_columns()[0].entity_path == "/points" + assert schema.component_columns()[0].component_name == "rerun.components.Color" + assert schema.component_columns()[1].entity_path == "/points" + assert schema.component_columns()[1].component_name == "rerun.components.Points3DIndicator" + assert schema.component_columns()[2].entity_path == "/points" + assert schema.component_columns()[2].component_name == "rerun.components.Position3D" + def test_full_view(self) -> None: view = self.recording.view(index="my_index", contents="points")