Conversation
a863840 to
7a96d83
Compare
append_record_batches
|
@greptileai review pls |
Greptile SummaryThis PR removes the
Confidence Score: 5/5The four-line removal is straightforward and the surviving finally-block correctly handles all cleanup paths. The change fixes a real behavioral inconsistency (flush on Exception but not on CancelledError) and the updated docstring accurately reflects the new semantics. The surrounding logic — the inner accumulator loop, linger timer, and finally-block task cancellation — is unchanged and correct. The only gap is a missing replacement test for the new contract, which is a quality concern and not a functional defect. tests/test_batching.py — the new discard-on-error contract has no test coverage. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[outer loop: await next record] -->|record is None| B[break — no yield]
A -->|record received| C[acc.add record]
C --> D{linger > 0?}
D -->|yes| E[inner loop: await task with timeout]
D -->|no| F[inner loop: await anext]
E -->|timeout / acc full| G[yield acc.take]
F -->|record is None or acc full| G
G --> A
A -->|exception raised| H[finally: cancel pending task]
H --> I[partial batch discarded]
B --> J[finally: cancel pending task]
J --> K[done]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[outer loop: await next record] -->|record is None| B[break — no yield]
A -->|record received| C[acc.add record]
C --> D{linger > 0?}
D -->|yes| E[inner loop: await task with timeout]
D -->|no| F[inner loop: await anext]
E -->|timeout / acc full| G[yield acc.take]
F -->|record is None or acc full| G
G --> A
A -->|exception raised| H[finally: cancel pending task]
H --> I[partial batch discarded]
B --> J[finally: cancel pending task]
J --> K[done]
Reviews (2): Last reviewed commit: "as note" | Re-trigger Greptile |
reverts #49
closes #82