kou commented on code in PR #46416:
URL: https://github.com/apache/arrow/pull/46416#discussion_r2085838904


##########
cpp/src/arrow/filesystem/gcsfs.cc:
##########
@@ -353,7 +353,9 @@ class GcsFileSystem::Impl {
     // matches the prefix we assume it is a directory.
     std::string canonical = internal::EnsureTrailingSlash(path.object);
     auto list_result = client_.ListObjects(path.bucket, 
gcs::Prefix(canonical));
-    if (list_result.begin() != list_result.end()) {
+    
+    // Check that the result is valid before determining whether the list is 
empty.
+    if (list_result.begin() != list_result.end() && *list_result.begin()) {

Review Comment:
   Our empty result usage is wrong, right?
   It seems that this is not the correct Google Cloud Platform C++ Client 
Libraries usage.
   
   @coryan Could you tell us the correct usage of this? We want to detect 
whether `ListObjects()` returns an empty result or not here.



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