Skip to content

Commit 29ad350

Browse files
Pyre Bot Jrfacebook-github-bot
authored andcommitted
Add annotations to torchx
Reviewed By: shannonzhu Differential Revision: D33968273 fbshipit-source-id: 395c9472c78561e066a572c4d428bdf610258c28
1 parent 787bb8f commit 29ad350

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

torchx/runner/test/api_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def test_get_schedulers(self, json_dumps_mock: MagicMock, _) -> None:
370370
runner.run(app, scheduler="local")
371371
local_sched_mock.submit.called_once_with(app, {})
372372

373-
def test_run_from_module(self, _) -> None:
373+
def test_run_from_module(self, _: str) -> None:
374374
runner = get_runner(name="test_session")
375375
app_args = ["--image", "dummy_image", "--script", "test.py"]
376376
with patch.object(runner, "schedule"), patch.object(

torchx/specs/test/file_linter_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ def _test_empty_fn() -> "AppDef":
2424

2525

2626
# Note if the function is moved, the tests need to be updated with new lineno
27-
# pyre-ignore[3]: Omit return value for testing purposes
28-
def _test_fn_no_return():
27+
def _test_fn_no_return() -> None:
2928
"""
3029
Function description
3130
"""

torchx/util/entrypoints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def load(group: str, name: str, default=None):
4949

5050
# pyre-ignore-all-errors[3, 2]
5151
def load_group(
52-
group: str, default: Optional[Dict[str, Any]] = None, ignore_missing=False
52+
group: str, default: Optional[Dict[str, Any]] = None, ignore_missing: bool = False
5353
):
5454
"""
5555
Loads all the entry points specified by ``group`` and returns

torchx/util/types.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ def _get_key(arg: str, spos: int, kv_delimiter: str = "=") -> str:
5151
return arg[spos:epos]
5252

5353

54-
def _get_value(arg: str, spos: int, kv_delimiter="=", pair_delimiter=",") -> str:
54+
def _get_value(
55+
arg: str, spos: int, kv_delimiter: str = "=", pair_delimiter: str = ","
56+
) -> str:
5557
epos: int = spos + 1
5658
while epos < len(arg) and arg[epos] != kv_delimiter:
5759
epos += 1

0 commit comments

Comments
 (0)