Leave a dotted key out of the runs export header
_leaves named a column for a key like `-1.0` that _dig can never read back, so the export showed an always-empty column. Skip such a key.
This commit is contained in:
@@ -441,9 +441,15 @@ def _leaves(value: Any, prefix: str = "") -> Iterator[tuple[str, Any]]:
|
||||
the numbers arrive inside `final_metrics` — and a record in one cell is
|
||||
not a column anybody can compare. Lists are left whole: a curve belongs in
|
||||
the long table, not in a cell of this one.
|
||||
|
||||
A key with a dot in its own name — a frequency written `-1.0` — is left
|
||||
out, and whatever sits under it with it: `_dig` cannot read such a path
|
||||
back, so naming it would promise a column that is always empty.
|
||||
"""
|
||||
if isinstance(value, dict):
|
||||
for key, inner in value.items():
|
||||
if "." in str(key):
|
||||
continue
|
||||
yield from _leaves(inner, f"{prefix}.{key}" if prefix else str(key))
|
||||
else:
|
||||
yield prefix, value
|
||||
|
||||
Reference in New Issue
Block a user