danepitkin commented on code in PR #37558:
URL: https://github.com/apache/arrow/pull/37558#discussion_r1323156056
##########
python/pyarrow/fs.py:
##########
@@ -356,7 +356,18 @@ 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))
+ start = start_p = 0
+ end = len(selector.base_dir)
+ if path.startswith("/"):
+ start_p += 1
+ if selector.base_dir.startswith("/"):
+ start += 1
+ if selector.base_dir.endswith("/"):
+ end -= 1
Review Comment:
Ah, good call. I forgot `strip()` takes from both ends. I was going to
suggest lstrip + rstrip, but that was two string copies instead of one copy
with an array slice.
--
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]