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:
2026-09-16 16:43:52 +02:00
parent d4f0345e97
commit 02907bbe27
3 changed files with 13 additions and 1 deletions
+5
View File
@@ -1121,6 +1121,9 @@ def exported():
"note": "n/a",
"final_metrics": {"train_loss": acc * 2},
"test_metrics": {"known": {"perfect": 1.0}},
# Keyed by a number written with its decimal point,
# which no dotted path can address.
"spectrum": {"-1.0": acc, "0.25": {"mean": acc}},
},
created_at=made + timedelta(seconds=index),
)
@@ -1199,6 +1202,8 @@ def test_an_exported_run_row_carries_every_recorded_input(
assert rows[0]["metric.final_metrics.train_loss"] == 0.5
assert rows[0]["metric.test_metrics.known.perfect"] == 1.0
assert "metric.note" not in rows[0]
# A key holding the separator cannot be read back, so it is not a column.
assert not any(key.startswith("metric.spectrum") for key in rows[0])
named = _lines(export(format="jsonl", metrics="test_metrics.known.perfect"))
assert list(named[0])[-1] == "metric.test_metrics.known.perfect"