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

Handle cache_timeout = 0 in GCSFileSystem #646

Merged
merged 2 commits into from
Nov 4, 2024

Conversation

amyewang
Copy link
Contributor

@amyewang amyewang commented Oct 30, 2024

Fixes #645

@amyewang amyewang marked this pull request as ready for review October 30, 2024 21:31
@martindurant
Copy link
Member

A test for this would be nice.

@amyewang
Copy link
Contributor Author

@martindurant added a test to test_expiry_keyword & passes as expected. let me know if you think it should live somewhere else!

@@ -1428,6 +1428,8 @@ def test_expiry_keyword():
assert gcs.dircache.listings_expiry_time == 1
gcs = GCSFileSystem(cache_timeout=1, token="anon")
assert gcs.dircache.listings_expiry_time == 1
gcs = GCSFileSystem(cache_timeout=0, token="anon")
assert gcs.dircache.listings_expiry_time == 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this imply that the cache is disabled? What was the previous value before this PR, None?

Copy link
Contributor Author

@amyewang amyewang Oct 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, based on the docstring the listings_expiry_time should be set to 0, which means cache has a timeout of 0. Before this change the gcs.dircache.listings_expiry_time evaluated to None, so the cache was enabled

@martindurant martindurant merged commit 7b9ef9c into fsspec:main Nov 4, 2024
5 checks passed
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 this pull request may close these issues.

GCSFileSystem doesn't properly handle cache_timeout = 0
2 participants