Skip to content

Commit 29180a0

Browse files
authored
Fix bug in dumper (#586)
1 parent b280f6a commit 29180a0

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/pdl/pdl_dumper.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,10 @@ def block_to_dict( # noqa: C901
127127
if block.modelResponse is not None:
128128
d["modelResponse"] = block.modelResponse
129129
case GraniteioModelBlock():
130-
d["platform"] = str(block.platform)
131130
d["model"] = block.model
131+
d["platform"] = str(block.platform)
132+
d["backend"] = block.backend
133+
d["processor"] = block.processor
132134
if block.input is not None:
133135
d["input"] = block_to_dict(block.input, json_compatible)
134136
if block.parameters is not None:
@@ -173,7 +175,7 @@ def block_to_dict( # noqa: C901
173175
if block.trace:
174176
d["trace"] = block_to_dict(block.trace, json_compatible)
175177
case ImportBlock():
176-
d["imports"] = block.imports
178+
d["import"] = block.imports
177179
if block.trace:
178180
d["trace"] = block_to_dict(block.trace, json_compatible)
179181
case IfBlock():

tests/test_dump.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,5 @@ def test_dump() -> None:
3434
assert json1 == json2, yaml_file_name
3535
except PDLParseError:
3636
pass
37-
except Exception:
38-
pass
39-
# assert False, f"{yaml_file_name}: {repr(exc)}\n{s}"
37+
except Exception as exc:
38+
assert False, f"{yaml_file_name}: {repr(exc)}"

0 commit comments

Comments
 (0)