We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sample code
import os from s3fs import S3FileSystem fs = S3FileSystem() base_path = "s3://moonshot-train-data/test_data/test_s3fs/" def join_path(*args): return os.path.join(base_path, *args) def test_exists(path): print(path, fs.exists(os.path.join(path))) fs.touch(join_path("a/b/c.txt")) print("=== before glob ===") test_exists(join_path("a/b/c.txt")) test_exists(join_path("a/b/")) test_exists(join_path("a/b")) test_exists(join_path("a/")) test_exists(join_path("a")) list(fs.glob(join_path("**/*.txt"))) print("=== after glob ===") test_exists(join_path("a/b/c.txt")) test_exists(join_path("a/b/")) test_exists(join_path("a/b")) test_exists(join_path("a/")) test_exists(join_path("a")) fs.invalidate_cache() print("=== invalidate_cache ===") test_exists(join_path("a/b/c.txt")) test_exists(join_path("a/b/")) test_exists(join_path("a/b")) test_exists(join_path("a/")) test_exists(join_path("a"))
Got
=== before glob === s3://moonshot-train-data/test_data/test_s3fs/a/b/c.txt True s3://moonshot-train-data/test_data/test_s3fs/a/b/ True s3://moonshot-train-data/test_data/test_s3fs/a/b True s3://moonshot-train-data/test_data/test_s3fs/a/ True s3://moonshot-train-data/test_data/test_s3fs/a True === after glob === s3://moonshot-train-data/test_data/test_s3fs/a/b/c.txt True s3://moonshot-train-data/test_data/test_s3fs/a/b/ True s3://moonshot-train-data/test_data/test_s3fs/a/b True s3://moonshot-train-data/test_data/test_s3fs/a/ False # <-- Here s3://moonshot-train-data/test_data/test_s3fs/a False # <-- And here === invalidate_cache === s3://moonshot-train-data/test_data/test_s3fs/a/b/c.txt True s3://moonshot-train-data/test_data/test_s3fs/a/b/ True s3://moonshot-train-data/test_data/test_s3fs/a/b True s3://moonshot-train-data/test_data/test_s3fs/a/ True s3://moonshot-train-data/test_data/test_s3fs/a True
Something wrong with the DirCache, create S3FileSystem with use_listings_cache=True or call invalidate_cache() can workaround
DirCache
use_listings_cache=True
invalidate_cache()
Python==3.11.9 fsspec==2024.5.0 s3fs==2024.5.0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Sample code
Got
Something wrong with the
DirCache
, create S3FileSystem withuse_listings_cache=True
or callinvalidate_cache()
can workaroundThe text was updated successfully, but these errors were encountered: