This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new 1aea20bcf3 GH-33824: [C++] Improve error message on diescovery failure
(#33848)
1aea20bcf3 is described below
commit 1aea20bcf385de4369f0b1bff1cb2a2cdf2addff
Author: Sagnik Dutta <[email protected]>
AuthorDate: Mon Feb 6 08:54:01 2023 +0530
GH-33824: [C++] Improve error message on diescovery failure (#33848)
### Rationale for this change
Grammatical correctness of message on an exception from
pyarrow.lib.ArrowInvalid
### What changes are included in this PR?
Removed a redundant period in the exception message
### Are these changes tested?
No, this is a more of a string amendment and should cause any failures or
issues.
I can test it out if this deems to be mandatory.
### Are there any user-facing changes?
User will be greeted with a correct(grammatically) exception message in
case of an error.
* Closes: #33824
Lead-authored-by: Sagnik Dutta <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
cpp/src/arrow/dataset/discovery.cc | 3 +--
cpp/src/arrow/dataset/test_util_internal.h | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/cpp/src/arrow/dataset/discovery.cc
b/cpp/src/arrow/dataset/discovery.cc
index a38ec00bb9..2aca85e6ad 100644
--- a/cpp/src/arrow/dataset/discovery.cc
+++ b/cpp/src/arrow/dataset/discovery.cc
@@ -244,8 +244,7 @@ Result<std::vector<std::shared_ptr<Schema>>>
FileSystemDatasetFactory::InspectSc
if (ARROW_PREDICT_FALSE(!result.ok())) {
return result.status().WithMessage(
"Error creating dataset. Could not read schema from '", info.path(),
- "': ", result.status().message(), ". Is this a '",
format_->type_name(),
- "' file?");
+ "'. Is this a '", format_->type_name(), "' file?: ",
result.status().message());
}
schemas.push_back(result.MoveValueUnsafe());
}
diff --git a/cpp/src/arrow/dataset/test_util_internal.h
b/cpp/src/arrow/dataset/test_util_internal.h
index 991d992c0d..4fdd35c480 100644
--- a/cpp/src/arrow/dataset/test_util_internal.h
+++ b/cpp/src/arrow/dataset/test_util_internal.h
@@ -482,7 +482,7 @@ class FileFormatFixtureMixin : public ::testing::Test {
::testing::AllOf(
::testing::HasSubstr(make_error_message("/herp/derp")),
::testing::HasSubstr(
- "Error creating dataset. Could not read schema from
'/herp/derp':"),
+ "Error creating dataset. Could not read schema from
'/herp/derp'."),
::testing::HasSubstr("Is this a '" + format_->type_name() + "'
file?")));
}