Skip to content

Commit 638397c

Browse files
committed
Handling check for dataset_id in get_run()
1 parent 3fab583 commit 638397c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

openml/runs/functions.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ def get_run(run_id: int, ignore_cache: bool = False) -> OpenMLRun:
579579

580580
try:
581581
if not ignore_cache:
582-
return _get_cached_run(run_id)
582+
_get_cached_run(run_id)
583583
else:
584584
raise OpenMLCacheException(message='dummy')
585585

@@ -665,8 +665,11 @@ def obtain_field(xml_obj, fieldname, from_server, cast=None):
665665

666666
if 'oml:input_data' in run:
667667
dataset_id = int(run['oml:input_data']['oml:dataset']['oml:did'])
668-
elif not from_server:
669-
dataset_id = None
668+
else:
669+
if not from_server:
670+
dataset_id = None
671+
else:
672+
raise ValueError('Uploaded run does not contain input_data.')
670673

671674
files = OrderedDict()
672675
evaluations = OrderedDict()

0 commit comments

Comments
 (0)