Repository navigation
fix(report): do not claim no non-matches for bulk results without records - #625
WilliamK112 wants to merge 5 commits into
Conversation
…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>
| 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 |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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
|
Merged |
sromoam
left a comment
There was a problem hiding this comment.
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
-
The
[]toNonechange is breaking and needs its own### Changedentry (CHANGELOG.md:384). Ondev,for nm in aggregate_from_comparisons([gt.compare_with(pred, include_confusion_matrix=True)]).non_matchesloops zero times. Here it raisesTypeError: 'NoneType' object is not iterable, andsave_metrics()writesnullwhere it wrote[]. That is the same kind of change as dropping theevaluator_format=Truenon_matcheskey, which the changelog lists under### Removedas 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
### Fixedbullet then only needs the report and printer part (suggestion inline).
Smaller
- The test README says every document in
errorswas never compared (tests/reporting/html/README.md:47). An accumulator failure is recorded there too, with anaccumulatorkey, and its document was compared, which is why the count skips it. Suggestion inline, with vawsgit'selide_errorsnote 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.
| - 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)). |
There was a problem hiding this comment.
With the value change moved to ### Changed (see the review body), this bullet only needs the report and printer part:
| - 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)). |
| - `[]`: collected, none produced. The only state that may claim success, and only when no document | ||
| raised: a document in `errors` was never compared (#425). |
There was a problem hiding this comment.
An errors record with an accumulator key belongs to a document that was compared. This also adds vawsgit's elide_errors note:
| - `[]`: 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>
|
Thanks @sromoam. Pushed 605414a:
Docs and changelog only, no code change. I'll bring |
Signed-off-by: Ching-Wei Kang <ckang53@wisc.edu>
|
1.1.0 has landed, so I merged current |
…ries Signed-off-by: Ching Wei Kang <164879897+WilliamK112@users.noreply.github.com>
|
#696 landed on |
Issue #, if available: #425 (both producers; the
EvalResultnote 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.":update_from_comparison_result()read a missingnon_matcheskey as "none". It now remembers that, andcompute()returnsnon_matches=Nonewhen there are no records and at least one result lacked the key, soaggregate_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 iteratenon_matchesfrom defaultcompare_with()results now getNone, as they already do withdocument_non_matches=False. That is a breaking change, so the CHANGELOG lists it under### Changed.The terminal printer had the same two outputs and follows the same rule.
bulk-evaluation.md, the test README and a### Fixedchangelog bullet are updated.Not covered:
get_state()does not carrynon_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
devat f264bfd:dev'ssrcand pass here, the other 3 pin behaviour that must not change.uv run pytest -qon Windows: 6,570 passed, against 6,563 ondev, with the same 9 failures on both (deep-nesting and recursion tests, and one gallery path test).ruff checkis clean on the changed files anddocs/check_links.pypasses.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