From 39f348244d0250c2a97dd7b53778b48d28737b4f Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 27 Mar 2025 18:30:39 +0000 Subject: [PATCH] Better error message for from_tree --- src/python/qubed/Qube.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/python/qubed/Qube.py b/src/python/qubed/Qube.py index 0b38e60..5f3b077 100644 --- a/src/python/qubed/Qube.py +++ b/src/python/qubed/Qube.py @@ -154,10 +154,18 @@ class Qube: # Add to the dictionary at current stack level parent = stack[-1] key = list(current.keys())[0] + if key in parent: + raise ValueError( + f"This function doesn't yet support reading in uncompressed trees, repeated key is {key}" + ) parent[key] = current[key] else: # Top level key = list(current.keys())[0] + if root: + raise ValueError( + f"This function doesn't yet support reading in uncompressed trees, repeated key is {key}" + ) root = current[key] # Push to the stack