emkornfield commented on code in PR #12763:
URL: https://github.com/apache/arrow/pull/12763#discussion_r852553759
##########
cpp/src/arrow/filesystem/gcsfs.cc:
##########
@@ -318,19 +326,43 @@ class GcsFileSystem::Impl {
return GetFileInfoBucket(path, std::move(meta).status());
}
auto meta = client_.GetObjectMetadata(path.bucket, path.object);
- return GetFileInfoObject(path, meta);
+ Result<FileInfo> info = GetFileInfoObject(path, meta);
+ if (!info.ok() || info->type() != FileType::NotFound) {
+ return info;
+ }
+ // Not found case. It could be this was written to GCS with a different
+ // "Directory" convention. So it if there are is at least one objec that
+ // matches the prefix we assume it is a directory.
+ std::string canonical = internal::EnsureTrailingSlash(path.object);
+ std::string end = canonical;
+ end.back() += 1;
Review Comment:
yes, per comment below I didn't carefully read the docs. I thought Prefix
was really a StartOffset (i.e. we needed verify prefixes somehow). I'm
removing this code.
--
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]