Skip to content

fix(report): do not claim no non-matches for bulk results without records - #625

Open
WilliamK112 wants to merge 5 commits into
awslabs:devfrom
WilliamK112:fix/425-unrecorded-non-matches
Open

WilliamK112 wants to merge 5 commits into
awslabs:devfrom
WilliamK112:fix/425-unrecorded-non-matches

Conversation

@WilliamK112

@WilliamK112 WilliamK112 commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Issue #, if available: #425 (both producers; the EvalResult note at the end of the issue is not included, so this does not close it)

Description of changes:

Two bulk results still reached the HTML report as [] and were rendered as "No non-matches found.":

  • Results without records. update_from_comparison_result() read a missing non_matches key as "none". It now remembers that, and compute() returns non_matches=None when there are no records and at least one result lacked the key, so aggregate_from_comparisons() and JSONL replay of such results get the existing "No non-match records" text. Records that were collected are still returned. This changes a value: callers that iterate non_matches from default compare_with() results now get None, as they already do with document_non_matches=False. That is a breaking change, so the CHANGELOG lists it under ### Changed.
  • Documents that raised. With no records and document errors, the section now says "No non-matches in the documents that were compared. N could not be compared". A failed accumulator does not count, because its document was compared.

The terminal printer had the same two outputs and follows the same rule. bulk-evaluation.md, the test README and a ### Fixed changelog bullet are updated.

Not covered: get_state() does not carry non_matches, so a loaded or merged evaluator still returns [] for the documents it did not compare itself. I can open an issue for that if you would like one.

Checks, on dev at f264bfd:

  • 7 new tests; 4 fail on dev's src and pass here, the other 3 pin behaviour that must not change.
  • Full uv run pytest -q on Windows: 6,570 passed, against 6,563 on dev, with the same 9 failures on both (deep-nesting and recursion tests, and one gallery path test).
  • ruff check is clean on the changed files and docs/check_links.py passes.

Written with Claude Code.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

🤖 Generated with Claude Code

…cords

ProcessEvaluation.non_matches is None when there are no records and a
comparison result had no non_matches key. The HTML report and the terminal
printer say how many documents could not be compared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@vawsgit vawsgit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM!

self._non_matches = []
# Set once a comparison result carries no `non_matches` key, so an empty
# list no longer means that every field matched (#425)
self._non_matches_uncollected = False

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional, not blocking (you list it under "Not covered"). get_state() does not carry this flag, so it is lost on a round trip. An evaluator that returns non_matches=None gives [] and "No non-matches found." after load_state(get_state()), and the same happens when it is merged into a clean evaluator with merge_state(). dev already does this, so it is not a regression. An issue for it, together with the missing non_matches in the state, would be worth having.

Measured with PYTHONPATH set to each tree's src. On this head: aggregated results with no records give None and the "No non-match records" text, and one clean document plus one raised document gives "1 could not be compared". dev prints "No non-matches found." for both. The 7 new tests pass here, and 4 of them fail on dev's src. Full suite on this head: 6580 passed, 13 skipped, 1 xfailed. ruff check and docs/check_links.py pass.

# A document that raised was never compared, so it has no records
# and is not clean (#425). A failed accumulator is not counted: its
# document was compared.
failed = sum(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional, not blocking: with elide_errors=True, a document that raised leaves no record in errors, so failed is 0 here and the report still says "No non-matches found." (one clean document plus update(None, None) gives that on this head). That fits what elide_errors means, so a short note in the README's three-state list would be enough.

…ches

Signed-off-by: Ching Wei Kang <164879897+WilliamK112@users.noreply.github.com>

# Conflicts:
#	tests/reporting/html/test_html_non_match_records.py
@WilliamK112

Copy link
Copy Markdown
Contributor Author

Merged dev to clear the conflict (076fff0). The only clash was in tests/reporting/html/test_html_non_match_records.py: this PR's new tests are kept, and the last test now uses dev's #608 version (..._without_records_says_so). The CHANGELOG bullet stays under [Unreleased] → ### Fixed. The full suite passes apart from the same 9 Windows-only failures that dev has (deep-nesting timeouts and one gallery path test).

@sromoam sromoam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @WilliamK112, I rechecked this at 076fff0. Both #425 cases (an aggregated default result, and a bulk run where a document raised) print "No non-matches found." on dev and are fixed here, 4 of the 7 new tests fail on dev, and the full suite passes at this head (7125 passed). The merge kept dev's #608 test alongside your new ones, and the reporting and evaluator tests pass merged with current dev.

Must fix

  1. The [] to None change is breaking and needs its own ### Changed entry (CHANGELOG.md:384). On dev, for nm in aggregate_from_comparisons([gt.compare_with(pred, include_confusion_matrix=True)]).non_matches loops zero times. Here it raises TypeError: 'NoneType' object is not iterable, and save_metrics() writes null where it wrote []. That is the same kind of change as dropping the evaluator_format=True non_matches key, which the changelog lists under ### Removed as breaking. Something like this under ### Changed:

    - **`ProcessEvaluation.non_matches` is `None` instead of `[]` when there are
      no records and a `compare_with()` result had no `non_matches` key**, as
      from `aggregate_from_comparisons()` or `update_from_comparison_result()`
      on default `compare_with()` results. This is a breaking change: code that
      iterates `non_matches` from those results now raises `TypeError`, and
      `save_metrics()` writes `null` for it. Records that were collected are
      still returned ([#425](https://github.com/awslabs/stickler/issues/425)).

    The ### Fixed bullet then only needs the report and printer part (suggestion inline).

Smaller

  1. The test README says every document in errors was never compared (tests/reporting/html/README.md:47). An accumulator failure is recorded there too, with an accumulator key, and its document was compared, which is why the count skips it. Suggestion inline, with vawsgit's elide_errors note folded in.

One heads-up: we're not merging anything outside the 1.1.0 milestone until 1.1.0 lands, so this will wait until after that even once it's ready. It conflicts with dev again, only in CHANGELOG.md, so please bring dev in after 1.1.0 lands rather than now.

Comment thread CHANGELOG.md Outdated
Comment on lines +382 to +388
- The HTML report and the terminal printer no longer print "No non-matches
found." for a bulk run that has no records to show it.
`ProcessEvaluation.non_matches` is now `None` instead of `[]` when there are
no records and a `compare_with()` result had no `non_matches` key, as from
`aggregate_from_comparisons()` on default results. When documents raised, both
say how many could not be compared
([#425](https://github.com/awslabs/stickler/issues/425)).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the value change moved to ### Changed (see the review body), this bullet only needs the report and printer part:

Suggested change
- The HTML report and the terminal printer no longer print "No non-matches
found." for a bulk run that has no records to show it.
`ProcessEvaluation.non_matches` is now `None` instead of `[]` when there are
no records and a `compare_with()` result had no `non_matches` key, as from
`aggregate_from_comparisons()` on default results. When documents raised, both
say how many could not be compared
([#425](https://github.com/awslabs/stickler/issues/425)).
- The HTML report and the terminal printer no longer print "No non-matches
found." for a bulk run that has no records to show it. When documents
raised, both say how many could not be compared
([#425](https://github.com/awslabs/stickler/issues/425)).

Comment thread tests/reporting/html/README.md Outdated
Comment on lines +46 to +47
- `[]`: collected, none produced. The only state that may claim success, and only when no document
raised: a document in `errors` was never compared (#425).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An errors record with an accumulator key belongs to a document that was compared. This also adds vawsgit's elide_errors note:

Suggested change
- `[]`: collected, none produced. The only state that may claim success, and only when no document
raised: a document in `errors` was never compared (#425).
- `[]`: collected, none produced. The only state that may claim success, and only when no document
raised: a document that raised was never compared (#425). An `errors` record with an
`accumulator` key does not count, since its document was compared. Under `elide_errors=True` a
document that raised leaves no record, so the section still claims success.

Moves the [] to None change for ProcessEvaluation.non_matches into its
own ### Changed entry, leaves the report and printer part under ### Fixed,
and says in the HTML test README which errors records count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@WilliamK112

Copy link
Copy Markdown
Contributor Author

Thanks @sromoam. Pushed 605414a:

  • Must fix: the [] → None change now has its own breaking ### Changed entry, in your wording, at the end of that section. The ### Fixed bullet now covers only the report and printer, per your inline suggestion.
  • Smaller: applied the tests/reporting/html/README.md suggestion: an errors record with an accumulator key doesn't count, and vawsgit's elide_errors note is folded in. It matches the "accumulator" not in error check in both section_generator.py and pretty_print.py.

Docs and changelog only, no code change. I'll bring dev in after 1.1.0 lands rather than now.

Signed-off-by: Ching-Wei Kang <ckang53@wisc.edu>
@WilliamK112

Copy link
Copy Markdown
Contributor Author

1.1.0 has landed, so I merged current dev in 7366e7a. The breaking-change note and the report/printer fix are both under the new [Unreleased]; the 1.1.0 notes are unchanged. The 324 reporting and bulk-evaluator tests, Ruff, and the docs link check pass.

@sromoam sromoam added this to the 1.2.0 milestone Dec 4, 2026
…ries

Signed-off-by: Ching Wei Kang <164879897+WilliamK112@users.noreply.github.com>
@WilliamK112

Copy link
Copy Markdown
Contributor Author

#696 landed on dev and touched the same part of [Unreleased], so this conflicted again. I merged current dev (8d7cc65) in 7885ebe: CHANGELOG only. The breaking ### Changed entry is kept, and the report/printer bullet now follows the #462 bullet under ### Fixed. Nothing else differs from 7366e7a; the reporting and bulk-evaluator tests match dev on my Windows machine.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants