You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The implementations of S3Path and LocalS3Path diverge in the following way which disqualifies using LocalS3Path as a testing tool.
fromcloudpathlib.s3importS3Pathpath=S3Path("s3://this/path/does/not/exist")
path.mkdir(parents=True) # does nothing (because S3 doesn't have directories)print(list(path.glob("*"))) # returns []
fromcloudpathlib.localimportLocalS3Pathpath=LocalS3Path("s3://this/path/does/not/exist")
path.mkdir(parents=True) # again, does nothingprint(list(path.glob("*"))) # raises exception
To fix this in my own codebase, I added a check to LocalS3Path.glob to return an empty generator when the path is not a directory. However, I’m unsure if this fixes the issue in all cases and there might be other issues caused by directories not existing in S3 but locally.
The text was updated successfully, but these errors were encountered:
The implementations of S3Path and LocalS3Path diverge in the following way which disqualifies using
LocalS3Path
as a testing tool.To fix this in my own codebase, I added a check to
LocalS3Path.glob
to return an empty generator when the path is not a directory. However, I’m unsure if this fixes the issue in all cases and there might be other issues caused by directories not existing in S3 but locally.The text was updated successfully, but these errors were encountered: