Conversation
|
@greptileai review pls |
Greptile SummaryThis PR fixes a bug where partially-accumulated records were silently dropped when the source async iterator raised an exception before the batch was full. An
Confidence Score: 5/5Safe to merge — the fix is a minimal, well-targeted addition that closes a real data-loss scenario without touching unrelated paths. The change inserts a single No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A([Start]) --> B[await next record]
B --> C{record is None?}
C -- yes --> D[break outer loop]
C -- no --> E[acc.add record]
E --> F{linger > 0?}
F -- yes --> G[create_task anext\nawait with timeout]
F -- no --> H[await anext directly]
G --> I{task done\nin time?}
I -- no --> J[pending_next = task\nbreak inner loop]
I -- yes --> K[next_task.result]
K -- raises --> L((Exception))
H -- raises --> L
K -- returns None --> M[break inner loop]
H -- returns None --> M
K -- returns record --> E
H -- returns record --> E
J --> N[yield acc.take]
M --> N
N --> B
D --> O([Generator ends normally])
L --> P{acc.is_empty?}
P -- no --> Q[yield acc.take\nflush partial batch]
P -- yes --> R[raise]
Q --> R
R --> S([Exception propagates to caller])
N --> T{Exception thrown\ninto generator?}
T -- yes --> L
T -- no --> B
Reviews (3): Last reviewed commit: "cover both zero and non-zero linger in t..." | Re-trigger Greptile |
|
@greptileai addressed your comments. review again and update your score pls. |
closes #43