Skip to content

Fix Prediction.output_iterator #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2023
Merged

Fix Prediction.output_iterator #106

merged 1 commit into from
May 23, 2023

Conversation

evilstreak
Copy link
Contributor

The output variable is shadowed by the yielding loop, so when we hit the line:

previous_output = output

the value of output refers to the last value of output from the loop above, not the total output we received. That causes the client to shrink the output down to a single string (which, inconveniently, also is a valid argument to len()), which means we take the wrong slice of the output the next time through the loop.

@evilstreak evilstreak requested a review from joehoover May 22, 2023 19:35
@evilstreak evilstreak force-pushed the fix-iterator-output branch from 30cc968 to a4c2681 Compare May 22, 2023 19:35
The `output` variable is shadowed by the yielding loop, so when we hit
the line:

    previous_output = output

the value of `output` refers to the last value of `output` from the loop
above, not the total output we received. That causes the client to
shrink the output down to a single string (which, inconveniently, also
is a valid argument to `len()`), which means we take the wrong slice of
the output the next time through the loop.

Signed-off-by: Dominic Baggott <dominic.baggott@gmail.com>
@evilstreak evilstreak force-pushed the fix-iterator-output branch from a4c2681 to 2cfc397 Compare May 22, 2023 19:48
@mattt mattt merged commit 52979a6 into main May 23, 2023
@mattt mattt deleted the fix-iterator-output branch May 23, 2023 09:18
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.

2 participants