Skip to content

Commit eafbcd1

Browse files
committed
A couple more review fixes to make copilot happy
1 parent ddac9df commit eafbcd1

2 files changed

Lines changed: 14 additions & 15 deletions

File tree

cpp/src/arrow/filesystem/filesystem.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -593,10 +593,9 @@ Result<std::shared_ptr<FileSystem>> FileSystemFromUri(const std::string& uri,
593593
/// The expected type is specific to the backend and
594594
/// option name.
595595
/// Options are forwarded to schemes dispatched through a registered
596-
/// FileSystemFactory. A registered factory that does not support options
597-
/// (currently "s3") returns NotImplemented for non-empty options.
598-
/// Schemes not handled by a registered factory will also return
599-
/// NotImplemented for non-empty options.
596+
/// FileSystemFactory. Non-empty options return NotImplemented for a registered
597+
/// FileSystemFactory that does not support them or for schemes not handled by
598+
/// a registered factory.
600599
/// \param[out] out_path (optional) Path inside the filesystem.
601600
/// \return out_fs FileSystem instance.
602601
ARROW_EXPORT
@@ -634,11 +633,9 @@ Result<std::shared_ptr<FileSystem>> FileSystemFromUri(const std::string& uri,
634633
/// The expected type is specific to the backend and
635634
/// option name.
636635
/// Options are forwarded to schemes dispatched through a registered
637-
/// FileSystemFactory. A registered factory that does not support options
638-
/// (currently "s3") returns NotImplemented for non-empty options.
639-
/// Schemes not handled by a registered factory will also return
640-
/// NotImplemented for non-empty options.
641-
/// \param[in] io_context an IOContext which will be associated with the filesystem
636+
/// FileSystemFactory. Non-empty options return NotImplemented for a registered
637+
/// FileSystemFactory that does not support them or for schemes not handled by
638+
/// a registered factory.
642639
/// \param[out] out_path (optional) Path inside the filesystem.
643640
/// \return out_fs FileSystem instance.
644641
ARROW_EXPORT

cpp/src/arrow/testing/examplefs.cc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,16 @@ auto kExampleFileSystemModule = ARROW_REGISTER_FILESYSTEM(
4040
for (const auto& [key, value] : options) {
4141
EXPECT_TRUE(value.has_value());
4242
if (key == "example_option_string") {
43-
EXPECT_TRUE(value.type() == typeid(std::string));
44-
if (out_path != nullptr) {
45-
*out_path += "/" + std::any_cast<std::string>(value);
43+
if (const auto* s = std::any_cast<std::string>(&value)) {
44+
if (out_path != nullptr) *out_path += "/" + *s;
45+
} else {
46+
ADD_FAILURE() << "example_option_string has wrong type";
4647
}
4748
} else if (key == "example_option_int") {
48-
EXPECT_TRUE(value.type() == typeid(int));
49-
if (out_path != nullptr) {
50-
*out_path += "/" + std::to_string(std::any_cast<int>(value));
49+
if (const auto* i = std::any_cast<int>(&value)) {
50+
if (out_path != nullptr) *out_path += "/" + std::to_string(*i);
51+
} else {
52+
ADD_FAILURE() << "example_option_int has wrong type";
5153
}
5254
} else if (key == "example_typed_option") {
5355
if (const auto* opt =

0 commit comments

Comments
 (0)