From 8c63f4dec64334d0ef1b5b964aeb283025b293df Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Sun, 7 Jul 2024 15:17:26 -0700 Subject: [PATCH] always write using correct schema for the file --- meshtastic/slog/arrow.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meshtastic/slog/arrow.py b/meshtastic/slog/arrow.py index be908ce..d656bea 100644 --- a/meshtastic/slog/arrow.py +++ b/meshtastic/slog/arrow.py @@ -46,7 +46,9 @@ class ArrowWriter: # only need to look at the first row to learn the schema self.set_schema(pa.Table.from_pylist([self.new_rows[0]]).schema) - self.writer.write_batch(pa.RecordBatch.from_pylist(self.new_rows)) + self.writer.write_batch( + pa.RecordBatch.from_pylist(self.new_rows, schema=self.schema) + ) self.new_rows = [] def add_row(self, row_dict: dict):