Open
Conversation
mlafeldt
requested changes
Mar 4, 2026
Member
mlafeldt
left a comment
There was a problem hiding this comment.
Thanks!
Good fix and worth the breaking change. 👍
Left some comments for you to address before merging.
| let schema = FFI_ArrowSchema::try_from(schema.deref()).ok()?; | ||
| let schema = FFI_ArrowSchema::try_from(schema.deref()) | ||
| .map_err(|e| Error::DuckDBFailure(ffi::Error::new(ffi::DuckDBError), Some(e.to_string())))?; | ||
| let array_data = from_ffi(arrays, &schema).expect("ok"); |
Member
There was a problem hiding this comment.
Now that streaming_step returns a Result, we should replace .expect with .map_err(|e| ...)? too.
| Ok(None) => None, | ||
| Err(e) => { | ||
| // Clear the statement to prevent further iteration after error | ||
| self.stmt = None; |
Member
There was a problem hiding this comment.
No test verifies iterator yields None here. Please add assert!(stream.next().is_none()).
Member
There was a problem hiding this comment.
Nice to have: impl FusedIterator for ArrowStream<'_> {} to document this behavior
| let stream = stmt.stream_arrow([], schema)?; | ||
|
|
||
| let mut ok_batches = 0usize; | ||
| let mut stream = stream; |
Member
There was a problem hiding this comment.
Let's remove this and make the stream above mut.
| assert!(ok_batches > 0, "Expected at least one batch before error"); | ||
| let msg = format!("{e}"); | ||
| assert!( | ||
| msg == "INTERRUPT Error: Interrupted!", |
Member
There was a problem hiding this comment.
msg.contains("INTERRUPT") seems less brittle, but your call.
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.
When
duckdb_stream_fetch_chunkreturns null, it could indicate either end-of-stream or an error, but the code previously returnedNonein both cases, silently swallowing errors. This PR checksduckdb_result_errorto distinguish between the two and returnsResult<Option<...>>so callers can handle streaming failures.