Skip to content

Commit a4bcf5e

Browse files
committed
Overload signature for specific return type
1 parent abeff96 commit a4bcf5e

1 file changed

Lines changed: 29 additions & 1 deletion

File tree

bids2table/_b2t.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import logging
22
from functools import partial
33
from pathlib import Path
4-
from typing import List, Optional
4+
from typing import List, Literal, Optional, overload
55

66
from elbow.builders import build_parquet, build_table
77
from elbow.sources.filesystem import Crawler
@@ -13,6 +13,34 @@
1313
logger = logging.getLogger("bids2table")
1414

1515

16+
@overload
17+
def bids2table(
18+
root: StrOrPath,
19+
*,
20+
with_meta: bool = True,
21+
persistent: bool = False,
22+
index_path: Optional[StrOrPath] = None,
23+
exclude: Optional[List[str]] = None,
24+
incremental: bool = False,
25+
overwrite: bool = False,
26+
workers: Optional[int] = None,
27+
worker_id: Optional[int] = None,
28+
return_table: Literal[True] = True,
29+
) -> BIDSTable: ...
30+
@overload
31+
def bids2table(
32+
root: StrOrPath,
33+
*,
34+
with_meta: bool = True,
35+
persistent: bool = False,
36+
index_path: Optional[StrOrPath] = None,
37+
exclude: Optional[List[str]] = None,
38+
incremental: bool = False,
39+
overwrite: bool = False,
40+
workers: Optional[int] = None,
41+
worker_id: Optional[int] = None,
42+
return_table: Literal[False],
43+
) -> None: ...
1644
def bids2table(
1745
root: StrOrPath,
1846
*,

0 commit comments

Comments
 (0)