From 5cedba9def5c2de3ce09827189f0d5f44964f63c Mon Sep 17 00:00:00 2001 From: KV Date: Mon, 10 Jun 2024 21:40:44 +0200 Subject: [PATCH] Explain unexpeced top-level type (#383) Might help in reported issues like #342 --- src/wireviz/wireviz.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wireviz/wireviz.py b/src/wireviz/wireviz.py index 0a07ab62..ad3babc8 100755 --- a/src/wireviz/wireviz.py +++ b/src/wireviz/wireviz.py @@ -88,6 +88,9 @@ def parse( raise Exception("No output formats or return types specified") yaml_data, yaml_file = _get_yaml_data_and_path(inp) + assert isinstance( + yaml_data, dict + ), f"Expected a dict as top-level YAML input, but got: {type(yaml_data)}" if output_formats: # need to write data to file, determine output directory and filename output_dir = _get_output_dir(yaml_file, output_dir)