Better error message for from_tree

This commit is contained in:
Tom 2025-03-27 18:30:39 +00:00
parent 2884f9fff8
commit 39f348244d

View File

@ -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