Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions cpp/src/arrow/json/reader_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -741,9 +741,13 @@ TEST_P(StreamingReaderTest, PropagateErrorsNonLinewiseChunker) {
read_options_.block_size = 10;
parse_options_.newlines_in_values = true;

EXPECT_RAISES_WITH_MESSAGE_THAT(Invalid,
::testing::StartsWith("Invalid: JSON parse error"),
MakeReader(bad_first_block));
// (can't use ::testing::MatchesRegex because of
// https://github.com/google/googletest/issues/3084)
EXPECT_RAISES_WITH_MESSAGE_THAT(
Invalid,
::testing::AnyOf(::testing::StartsWith("Invalid: JSON parse error"),
::testing::StartsWith("Invalid: Failed to get JSON object")),
MakeReader(bad_first_block));

ASSERT_OK_AND_ASSIGN(reader, MakeReader(bad_middle_blocks));
AssertReadNext(reader, &batch);
Expand Down
4 changes: 2 additions & 2 deletions python/pyarrow/tests/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ def test_non_linewise_chunker_first_block(self):
'n': [0]
}
with pytest.raises(pa.ArrowInvalid,
match="JSON parse error *"):
match="(JSON parse error|Failed to get JSON object)"):
reader.read_next_batch()

with pytest.raises(StopIteration):
Expand All @@ -546,7 +546,7 @@ def test_non_linewise_chunker_bad_first_block(self):
'n': [0]
}
with pytest.raises(pa.ArrowInvalid,
match="JSON parse error *"):
match="(JSON parse error|Failed to get JSON object)"):
reader.read_next_batch()

with pytest.raises(StopIteration):
Expand Down
Loading