Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvandenbossche committed Dec 5, 2023
1 parent aa2182c commit 1d887b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cpp/src/arrow/filesystem/s3fs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2410,6 +2410,10 @@ class S3FileSystem::Impl : public std::enable_shared_from_this<S3FileSystem::Imp
DCHECK_GT(file_info.path().size(), bucket.size());
auto file_path = file_info.path().substr(bucket.size() + 1);
if (file_info.IsDirectory()) {
// the selector returns FileInfo objects for directories with a
// a path that never ends in a trailing slash, but for S3 the file
// needs to have a trailing slash to recognize it as direcotory
// (https://github.com/apache/arrow/issues/38618)
DCHECK_OK(internal::AssertNoTrailingSlash(file_path));
file_path = file_path + kSep;
}
Expand Down
2 changes: 2 additions & 0 deletions python/pyarrow/tests/test_fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,8 @@ def test_delete_dir(fs, pathfn):


def test_delete_dir_with_explicit_subdir(fs, pathfn):
# https://github.com/apache/arrow/issues/38618 (regression with S3 failing
# to delete directories, depending on whether they were created explicitly)
skip_fsspec_s3fs(fs)

d = pathfn('directory/')
Expand Down

0 comments on commit 1d887b7

Please sign in to comment.