diff --git a/python/pyarrow/fs.py b/python/pyarrow/fs.py index 567bea8ac05e8..36655c7d12863 100644 --- a/python/pyarrow/fs.py +++ b/python/pyarrow/fs.py @@ -356,7 +356,12 @@ def get_file_info_selector(self, selector): selector.base_dir, maxdepth=maxdepth, withdirs=True, detail=True ) for path, info in selected_files.items(): - infos.append(self._create_file_info(path, info)) + _path = path.strip("/") + base_dir = selector.base_dir.strip("/") + # Need to exclude base directory from selected files if present + # (fsspec filesystems, see GH-37555) + if _path != base_dir: + infos.append(self._create_file_info(path, info)) return infos