Repository navigation
Reject nested metric names that conflict with scalar parents - #909
Open
kshitijprasaddev wants to merge 2 commits into
Open
kshitijprasaddev wants to merge 2 commits into
kshitijprasaddev wants to merge 2 commits into
Conversation
for more information, see https://pre-commit.ci
|
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Logging a scalar metric and then a nested metric beneath it raises an internal
AttributeErrorafter the nested TSV has already been written. For example,log_metric("epoch", 0)followed bylog_metric("epoch/loss", 0.5)leaves history that is absent from the summary.Validate each existing summary parent before registering or dumping the metric. Raise
InvalidMetricNameErrornaming the conflict. This also checks resumed summaries and the internalstepvalue; normal sibling metrics and repeated leaf updates still work. Thelog_metricdocstring documents the error.Fixes #492.
Validation (Ubuntu 24.04, CPython 3.12.3):
plot=False, resume, internalstep, and successful sibling/leaf updates. Rejections preserve summary, registry and history files.setenv).pyproject.tomlinline-table spacing; its two unrelated formatting changes were reverted.twine checkpass. Whitespace checks pass.Optional ML framework integrations, other Python versions/platforms, and hosted CI are not claimed as tested. An initial coverage-enabled core run stalled in the asynchronous Studio tests and was interrupted; the subsequent complete coverage-enabled run passed all 246 cases. No production coverage percentage is claimed.
The current scope detects scalar parents when logging descendants; it does not change the existing reverse-order behavior of overwriting a subtree with a scalar.
AI assistance: OpenAI Codex investigated the issue, implemented and reviewed the patch, ran the reported validation, and prepared this PR. Human review is not claimed.
Follow-up — 2026-10-28
pre-commit.ci added commit
93c7a2awith the two existing TOML inline-table spacing fixes. The parsed configuration is unchanged. The branch has been synced locally and the complete all-files pre-commit run now passes. The test results above refer to the unchanged production/test source from810baee; no new runtime changes were made in this follow-up.The CLA assistant now reports an unsigned Contributor License Agreement. Signing requires the account holder; no agreement or signature has been supplied by the agent.