Skip to content

Commit

Permalink
Handle cache_timeout = 0 in GCSFileSystem (#646)
Browse files Browse the repository at this point in the history
* add is not none

* test
  • Loading branch information
amyewang authored Nov 4, 2024
1 parent 358ba23 commit 7b9ef9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gcsfs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def __init__(
version_aware=False,
**kwargs,
):
if cache_timeout:
if cache_timeout is not None:
kwargs["listings_expiry_time"] = cache_timeout
super().__init__(
self,
Expand Down
2 changes: 2 additions & 0 deletions gcsfs/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


def test_copy_cache_invalidated(gcs):
Expand Down

0 comments on commit 7b9ef9c

Please sign in to comment.