Reranko05 commented on code in PR #51038:
URL: https://github.com/apache/arrow/pull/51038#discussion_r4071894062


##########
cpp/src/arrow/json/reader_test.cc:
##########
@@ -1032,5 +1030,21 @@ TEST_F(AsyncStreamingReaderTest, 
StressSharedIoAndCpuExecutor) {
   AssertBatchSequenceEquals(expected.batches, batches);
 }
 
+TEST(ReaderTest, FailOnMalformedNumbers) {
+  auto read_options = ReadOptions::Defaults();
+  auto parse_options = ParseOptions::Defaults();
+  read_options.use_threads = false;
+
+  const std::vector<std::string> malformed = {
+      R"({"a": 01})",
+      R"({"a": 1.})",
+  };
+
+  for (const auto& json : malformed) {
+    auto result = ReadToTable(json, read_options, parse_options);
+    EXPECT_TRUE(result.status().IsInvalid()) << result.status().ToString();

Review Comment:
   Agreed. Updated the test to assert that the error starts with `Invalid: 
Failed to parse JSON number`.



-- 
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]

Reply via email to