Skip to content

Commit f24efe9

Browse files
committed
chore: fix some type hints
1 parent f5cd3a3 commit f24efe9

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

pins/boards.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424

2525
# Note that once we drop python 3.7, we can make this a Protocol
2626
class IFileSystem:
27+
28+
protocol: "str | list"
29+
2730
def ls(self, path: str) -> Sequence[str]:
2831
...
2932

pins/constructors.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
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
89

910

1011
class DEFAULT:
@@ -52,7 +53,8 @@ def board_deparse(board: BaseBoard):
5253
allow_pickle = ""
5354

5455
prot = board.fs.protocol
55-
if prot == "rsc":
56+
57+
if isinstance(board.fs, RsConnectFs):
5658
url = board.fs.api.server_url
5759
return f"board_rsconnect(server_url={repr(url)}{allow_pickle})"
5860
elif prot == "file":
@@ -72,10 +74,10 @@ def board(
7274
protocol: str,
7375
path: str = "",
7476
versioned: bool = True,
75-
cache: "DEFAULT | None" = DEFAULT,
77+
cache: "type[DEFAULT] | None" = DEFAULT,
7678
allow_pickle_read=None,
7779
storage_options: "dict | None" = None,
78-
board_factory: "callable | BaseBoard | None" = None,
80+
board_factory: "callable | type[BaseBoard] | None" = None,
7981
):
8082
"""General function for constructing a pins board.
8183

0 commit comments

Comments
 (0)