Skip to content

Commit

Permalink
GH-33824: [C++] Improve error message on diescovery failure (#33848)
Browse files Browse the repository at this point in the history
### 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 <sdutta@redhat.com>
Co-authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
  • Loading branch information
saltgen and kou committed Feb 6, 2023
1 parent 8233ed4 commit 1aea20b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions cpp/src/arrow/dataset/discovery.cc
Expand Up @@ -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());
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/dataset/test_util_internal.h
Expand Up @@ -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?")));
}

Expand Down

0 comments on commit 1aea20b

Please sign in to comment.