From 53da877de0e74aee7110b634f631bd76037019ca Mon Sep 17 00:00:00 2001 From: Jeremy Leibs Date: Mon, 16 Dec 2024 11:53:25 -0500 Subject: [PATCH] Add a basic unit test --- rerun_py/tests/unit/test_dataframe.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/rerun_py/tests/unit/test_dataframe.py b/rerun_py/tests/unit/test_dataframe.py index 69daa71d1da3..067f7fa63b34 100644 --- a/rerun_py/tests/unit/test_dataframe.py +++ b/rerun_py/tests/unit/test_dataframe.py @@ -380,3 +380,19 @@ def test_view_syntax(self) -> None: table = pa.Table.from_batches(batches, batches.schema) assert table.num_columns == 3 assert table.num_rows == 0 + + def test_roundtrip_send(self) -> None: + df = self.recording.view(index="my_index", contents="/**").select().read_all() + + with tempfile.TemporaryDirectory() as tmpdir: + rrd = tmpdir + "/tmp.rrd" + + rr.init("rerun_example_test_recording") + rr.dataframe.send_dataframe(df) + rr.save(rrd) + + round_trip_recording = rr.dataframe.load_recording(rrd) + + df_round_trip = round_trip_recording.view(index="my_index", contents="/**").select().read_all() + + assert df == df_round_trip