Repository navigation
fix(core_text): keep one response per row when input cells are empty - #536
Merged
SunnyHaze merged 1 commit intoOct 12, 2026
Merged
Conversation
PromptedGenerator, PromptedEvaluator, PromptedRefiner and RetrievalGenerator skip falsy rows when building the prompt batch, then assign the shorter response list back as a full column, so any empty cell crashes the run with "ValueError: Length of values does not match length of index". Write responses back at the positions they were generated from: skipped rows keep their original text in PromptedRefiner and default to an empty value in the others, where _parse_scores' failure value 0 is reused for the score column so PromptedFilter is unaffected. A batch whose response count does not match the prompt count now raises instead of silently shifting rows.
SunnyHaze
approved these changes
Oct 12, 2026
SunnyHaze
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, sincerely thanks!
|
能别给我发邮件了吗?烦不烦
…On Mon, Oct 12, 2026 at 04:08 Ma, Xiaochen ***@***.***> wrote:
Merged #536 <#536> into main.
—
Reply to this email directly, view it on GitHub
<#536?email_source=notifications&email_token=BXVY4YG2TQS3SXPLZO4FBOL5TSGORA5CNFSNUABQM5UWIORPF5TWS5BNNB2WEL2JONZXKZKFOZSW45CON52GSZTJMNQXI2LPNYXTGMZQGI4TGMRTGA3TRJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#event-33029323078>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BXVY4YCJKGGKLVZEW7R4PU35TSGORAVCNFSNUABFKJSXA33TNF2G64TZHM4DOMRQGA2TSOBVHNEXG43VMU5TKNZVHA4TANJSHAYKC5QC>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/BXVY4YF3OTMNPF6BBH6PXB35TSGORA5CNFSNUABQM5UWIORPF5TWS5BNNB2WEL2JONZXKZKFOZSW45CON52GSZTJMNQXI2LPNYXTGMZQGI4TGMRTGA3TRJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2KUZTPN52GK4S7NFXXG>
and Android
<https://github.com/notifications/mobile/android/BXVY4YBNQK6D6U5SS7SZEHT5TSGORA5CNFSNUABQM5UWIORPF5TWS5BNNB2WEL2JONZXKZKFOZSW45CON52GSZTJMNQXI2LPNYXTGMZQGI4TGMRTGA3TRJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>.
Download it today!
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
rikkurea-boop
added a commit
to rikkurea-boop/DataFlow
that referenced
this pull request
Oct 13, 2026
Bring OpenDCAI#536, OpenDCAI#553 and OpenDCAI#551 upstream changes into the existing PR branch without rebasing away the previously reviewed Text2Model commits.
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.
What this fixes
Four
core_textoperators build their prompt batch by skipping rows whoseinput_keycell is falsy, and then write the model's responses back as awhole column:
Because the skipped rows never made it into the batch, that list is shorter
than the frame, so any empty cell takes the run down with:
Affected:
PromptedGenerator,PromptedEvaluator,PromptedRefinerandRetrievalGenerator.This is easy to hit in practice — it's normal for a frame to arrive with a few
blank cells after a source read or an upstream filter — and the worse variant
is silent misalignment rather than a crash: if the lengths happen to work out,
row N ends up with row N+1's answer. Either way the
if raw_contentguardalready anticipates empty rows, so I don't think the crash on the write side
was the intent.
How it's fixed
Each operator now remembers which row positions actually produced a prompt and
writes responses back at those positions, so the frame keeps exactly one value
per row. For the default value of a skipped row I kept each operator's existing
semantics rather than inventing a new rule:
PromptedGenerator/RetrievalGenerator— empty string in the output column.PromptedRefiner— keeps its original text, since it overwritesinput_keyinplace and dropping the value would be data loss.
PromptedEvaluator— reuses the0that_parse_scoresalready returns foran unparseable response, so "no score produced" and "score parsed as
unparseable" stay the same thing.
PromptedFiltercallsPromptedEvaluator.eval()on a pre-filtered frame, so itis unaffected; there is a test for it to keep that honest.
A batch that comes back with a response count that doesn't match the number of
prompts now raises instead of shifting rows. I followed #525 here, which does
the same thing for
Text2QAGenerator— mismatched counts are a serving problem,and silently reallocating them isn't a useful answer.
I also corrected three log lines that said
Running PromptGenerator...insidethe evaluator and the refiner, and updated
PromptedRefiner.get_desc, whichused to document the length-mismatch error as expected behaviour.
Testing
test/cpu_only/test_core_text_empty_row_alignment.pycovers all four operatorsagainst a stub serving and an in-memory storage, parametrised over which row is
empty (first / middle / last / none), and asserts the untouched rows keep their
identity — the fixture deliberately uses non-contiguous index labels
[3, 7, 11]so a positional/label mix-up can't pass.
pytestmark = pytest.mark.cpu, no APIkey or GPU needed.
Running that on upstream
mainand on this branch gives the same set offailures (
word2numberanddatasketchare missing from my local venv); theonly delta is the 14 new passes. Ruff over the four changed files reports the
same 10 pre-existing
F401/F841findings before and after.One caveat on the new tests:
RetrievalGeneratorimportsdataflow.servingatmodule level, which needs the Google Cloud extras, so those four cases are behind
pytest.importorskip. They run in the CI matrix. I verified them locally bystubbing that import, and the alignment holds for all four empty-row positions.
Making that import lazy seemed like a separate change, so I left it alone here.
Notes
No existing issue for this, so no
Fixes #. Happy to open one first if you'dprefer it tracked. The change is confined to
core_textand doesn't touch anyoperator signature, so
test_register.py's conventions are unchanged.