From 64c4de72aa275e8f369cacb87c0b662ac431b843 Mon Sep 17 00:00:00 2001 From: Brianna Smart Date: Wed, 3 Jan 2024 14:46:48 -0800 Subject: [PATCH] Update validateAvroRoundTrip --- python/lsst/alert/packet/bin/validateAvroRoundTrip.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/lsst/alert/packet/bin/validateAvroRoundTrip.py b/python/lsst/alert/packet/bin/validateAvroRoundTrip.py index 51f8f41..8423888 100755 --- a/python/lsst/alert/packet/bin/validateAvroRoundTrip.py +++ b/python/lsst/alert/packet/bin/validateAvroRoundTrip.py @@ -120,7 +120,7 @@ def main(): check_file_round_trip(args.cutout_template, message.pop('cutoutTemplate')['stampData']) - message_size = len(json.dumps(message).encode('utf-8')) + message_size = len(json.dumps(message, default = repr).encode('utf-8')) print("Size in bytes of JSON-encoded message (excl. stamps): %d" % (message_size,)) print("Size in bytes of stamps: %d" % (stamp_size,)) print("TOTAL: %d" % (stamp_size + message_size,)) @@ -135,7 +135,7 @@ def main(): # populated with nulls; # - Precision has been lost on the floats. if args.print: - print(json.dumps(message, sort_keys=True, indent=4)) + print(json.dumps(message, sort_keys=True, indent=4, default = repr)) if __name__ == "__main__":