refactor(core_text): split BenchDatasetEvaluatorQuestion.run and fix row indexing - #514
Merged
Merged
Conversation
Collaborator
|
Thanks for your interest in DataFlow and for taking the time to contribute these fixes. I noticed that this PR currently includes most of the commits from #513 in addition to the I’ll leave a separate comment on #513 regarding the shared runtime fixes. |
SunnyHaze
force-pushed
the
refactor/bench-evaluator-run
branch
from
August 12, 2026 12:59
60ba1da to
f0507ae
Compare
…xing run() carried both evaluation modes inline at ~90 lines. Splitting it into per-mode helpers made two latent problems visible: - Match mode indexed the answer Series by position. That is a label lookup on a pandas Series, so any frame with a non-default index -- what an upstream filter produces -- raised KeyError. Now iterates dataframe.index. - Column validation ran after 'answer_match_result' had already been added, so a frame failing validation came back mutated. Also drops the unused numpy and json imports and the dead result_mask.
SunnyHaze
force-pushed
the
refactor/bench-evaluator-run
branch
from
August 12, 2026 13:37
f0507ae to
28a8238
Compare
Collaborator
|
Looks good to me. Thanks~ |
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.
Builds on #513.
run()held both evaluation modes inline at ~90 lines; this splits it into per-mode helpers.That surfaced two real problems. Match mode indexed the answer Series by position, which is a label lookup on a pandas Series, so any frame with a non-default index (what an upstream filter produces) raised
KeyError. And column validation ran afteranswer_match_resultwas already added, so a frame failing validation came back mutated. Both have new tests; the indexing one is parametrised over both modes on a frame indexed[3, 7].Behaviour is otherwise unchanged. I exercised semantic, match and subquestion modes on gapped indices against the previous implementation.
pytest test/goes 75 to 78 passing, same 8 pre-existing failures.Happy to adjust.