Skip to content

fix: preserve punctuation in job metric names - #1366

Open
rioyu123 wants to merge 1 commit into
amazon-braket:mainfrom
rioyu123:codex/braket-metric-names
Open

rioyu123 wants to merge 1 commit into
amazon-braket:mainfrom
rioyu123:codex/braket-metric-names

Conversation

@rioyu123

Copy link
Copy Markdown

Issue #, if available:

N/A

Description of changes:

log_metric writes names such as train/loss and eval/loss unchanged, but LogMetricsParser reads both as loss. The metrics end up in one column, where MIN/MAX selects between unrelated values. Hyphens and periods also cause names to lose their prefixes.

This change preserves the complete non-whitespace name token before =. Value parsing, delimiters and statistics handling are unchanged. Names containing whitespace, = or ; remain outside this fix.

Punctuated names now appear under their full name instead of the truncated suffix. Hand-formatted logs should separate names from preceding text with whitespace, as log_metric already does.

Testing done:

  • Added two regression cases that capture actual log_metric output and check slash, hyphen, period and underscore names under MIN and MAX. Both fail on the original parser.
  • Linux, CPython 3.12: 3,498 unit tests passed, 131 xfailed.
  • tox -e linters_check,type-check,docs,coverage-check passed; coverage is 100%. The docs build completed with 467 warnings.
  • Live AWS integration tests were not run. This change only affects local parsing of fetched log text.

Merge Checklist

General

No documentation change is needed for this parser correction.

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Signed-off-by: Rio Yu <52408936+rioyu123@users.noreply.github.com>
@rioyu123
rioyu123 requested a review from a team as a code owner October 10, 2026 07:45
@github-actions github-actions Bot added the aws label Oct 10, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant