Skip to content
New issue

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

GCSFileSystem doesn't properly handle cache_timeout = 0 #645

Closed
amyewang opened this issue Oct 24, 2024 · 1 comment · Fixed by #646
Closed

GCSFileSystem doesn't properly handle cache_timeout = 0 #645

amyewang opened this issue Oct 24, 2024 · 1 comment · Fixed by #646

Comments

@amyewang
Copy link
Contributor

When using GCSFileSystem, I would expect passing in cache_timeout = 0 to result in no caching, since according to the docs: Set cache_timeout <= 0 for no caching, None for no cache expiration. Yet when cache_timeout = 0, self.cache_timeout is set to None and caching is being used.

When cache_timeout = 0, self.cache_timeout = cache_timeout or kwargs.pop("listings_expiry_time", None) is evaluating to None, since the value of 0 is falsy. Currently circumventing this by passing in cache_timeout = -1, but docs state that a value of 0 should be supported and indicate no caching.

@martindurant
Copy link
Member

OK, so the docstring and the functionality need to be brought into line - can you please make the PR? Ideally we should have the same behaviour between implementations, so the change might be in fsspec.dircache . I don't mind which sentinel value means "no caching", especially since we also have use_listings_cache. I suppose an expiry time of 0 could be understood as no caching, or as no expiry (i.e., use cache and never make stale).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants