|
7 | 7 | from oslo_concurrency import lockutils |
8 | 8 | import xmltodict |
9 | 9 |
|
10 | | -from ..exceptions import OpenMLCacheException |
| 10 | +from ..exceptions import OpenMLCacheException, OpenMLServerNoResult |
11 | 11 | from ..datasets import get_dataset |
12 | 12 | from .task import OpenMLTask, _create_task_cache_dir |
13 | 13 | from .. import config |
@@ -55,9 +55,9 @@ def _get_estimation_procedure_list(): |
55 | 55 | Returns |
56 | 56 | ------- |
57 | 57 | procedures : list |
58 | | - A list of all estimation procedures. Every procedure is represented by a |
59 | | - dictionary containing the following information: id, |
60 | | - task type id, name, type, repeats, folds, stratified. |
| 58 | + A list of all estimation procedures. Every procedure is represented by |
| 59 | + a dictionary containing the following information: id, task type id, |
| 60 | + name, type, repeats, folds, stratified. |
61 | 61 | """ |
62 | 62 |
|
63 | 63 | xml_string = _perform_api_call("estimationprocedure/list") |
@@ -138,7 +138,10 @@ def list_tasks(task_type_id=None, offset=None, size=None, tag=None): |
138 | 138 |
|
139 | 139 |
|
140 | 140 | def _list_tasks(api_call): |
141 | | - xml_string = _perform_api_call(api_call) |
| 141 | + try: |
| 142 | + xml_string = _perform_api_call(api_call) |
| 143 | + except OpenMLServerNoResult: |
| 144 | + return [] |
142 | 145 | tasks_dict = xmltodict.parse(xml_string, force_list=('oml:task',)) |
143 | 146 | # Minimalistic check if the XML is useful |
144 | 147 | if 'oml:tasks' not in tasks_dict: |
|
0 commit comments