Skip to content

Commit dcf9e10

Browse files
committed
fix!: remove fsspec board caching from constructors
1 parent f24efe9 commit dcf9e10

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

pins/constructors.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from .boards import BaseBoard, BoardRsConnect, BoardManual
66
from .cache import PinsCache, PinsRscCache, PinsAccessTimeCache, prefix_cache
77
from .config import get_data_dir, get_cache_dir
8-
from .rsconnect.fs import RsConnectFs
98

109

1110
class DEFAULT:
@@ -54,7 +53,7 @@ def board_deparse(board: BaseBoard):
5453

5554
prot = board.fs.protocol
5655

57-
if isinstance(board.fs, RsConnectFs):
56+
if prot == "rsc":
5857
url = board.fs.api.server_url
5958
return f"board_rsconnect(server_url={repr(url)}{allow_pickle})"
6059
elif prot == "file":
@@ -111,10 +110,17 @@ def board(
111110
fsspec.filesystem.
112111
board_factory:
113112
An optional board class to use as the constructor.
113+
114+
Note
115+
----
116+
Many fsspec implementations of filesystems cache the searching of files, which may
117+
cause you to not see pins saved by other people. Disable this on these file systems
118+
with `storage_options = {"cache_timeout": 0}`.
119+
114120
"""
115121

116122
if storage_options is None:
117-
storage_options = {}
123+
storage_options = {"listings_expiry_time": 0}
118124

119125
# TODO: at this point should just manually construct the rsc board directly
120126
# from board_rsconnect...
@@ -276,7 +282,7 @@ def board_github(
276282
versioned,
277283
cache,
278284
allow_pickle_read=allow_pickle_read,
279-
storage_options={"org": org, "repo": repo},
285+
storage_options={"org": org, "repo": repo, "listings_expiry_time": 0},
280286
)
281287

282288

pins/tests/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def get_param_from_env(entry):
117117
return value
118118

119119
def create_tmp_board(self, src_board=None) -> BaseBoard:
120-
fs = filesystem(self.fs_name)
120+
fs = filesystem(self.fs_name, listings_expiry_time=0)
121121
temp_name = str(uuid.uuid4())
122122

123123
if isinstance(self.path, TemporaryDirectory):

0 commit comments

Comments
 (0)