bkietz commented on code in PR #39892:
URL: https://github.com/apache/arrow/pull/39892#discussion_r1478507640
##########
cpp/src/arrow/csv/parser_test.cc:
##########
@@ -376,6 +383,19 @@ TEST(BlockParser, TruncatedData) {
}
}
+TEST(BlockParser, TruncatedDataViews) {
+ // If non-last block is truncated, parsing stops
+ BlockParser parser(ParseOptions::Defaults(), /*num_cols=*/3);
+ AssertParsePartial(parser, Views({"a,b,", "c\n"}), 0);
+ // (XXX should we guarantee this one below?)
Review Comment:
I don't think the BlockParser actually needs to return an error (*maybe* a
debug assertion). I'm mostly concerned with how we test your solution. By
analogy: if we had a calculator object, it'd be better to test whatever uses
that object rather than unit testing `calculator.divide(1, 0)`. BlockParser
might be refactored later in a way which doesn't change reader behavior as long
as chunking is valid but *does* invalidate these unit tests, and I'd like to
avoid placing such a constraint on future developers. To that end: let's test
the reader instead of the parser
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]