Commit 4944e5f
Allow empty session name for APIs that take it
Summary:
Makes the session name returning and accepting APIs symmetric by allowing empty session names.
Today `torchx.runner.Runner()` takes an empty string as `session_name` and returns an `app_handle` with an empty session name (e.g. `local:///app-id`) when the `run()` or `schedule()` methods are called (see the newly added unittest in `torchx/runner/test/api_test.py#test_empty_session_id()`)
However runner APIs that accept `app_handle` (e.g. `runner.cancel()`) will error when the session name is empty. This makes the APIs non-symmetric since the `app_handle` returned by `run/schedule` APIs cannot be used.
This PR fixes this.
Differential Revision: D737993331 parent 41be1d8 commit 4944e5f
3 files changed
+37
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
135 | 162 | | |
136 | 163 | | |
137 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1122 | 1122 | | |
1123 | 1123 | | |
1124 | 1124 | | |
1125 | | - | |
| 1125 | + | |
1126 | 1126 | | |
1127 | 1127 | | |
1128 | 1128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
380 | 389 | | |
381 | 390 | | |
382 | 391 | | |
| |||
0 commit comments