Skip to content

Commit b256aec

Browse files
committed
Fixing dataset retrieval
1 parent 0f83e32 commit b256aec

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
@@ -668,9 +668,12 @@ def obtain_field(xml_obj, fieldname, from_server, cast=None):
668668
elif not from_server:
669669
dataset_id = None
670670
else:
671-
raise ValueError('Uploaded run does not contain input_data for run_id={}.\n'
672-
'Kindly report this server-side issue at: '
673-
'https://github.com/openml/openml-python/issues'.format(run_id))
671+
# fetching the task to obtain dataset_id
672+
t = openml.tasks.get_task(task_id, download_data=False)
673+
if not hasattr(t, 'dataset_id'):
674+
raise ValueError("Unable to fetch dataset_id from the task({}) "
675+
"linked to run({})".format(task_id, run_id))
676+
dataset_id = t.dataset_id
674677

675678
files = OrderedDict()
676679
evaluations = OrderedDict()

0 commit comments

Comments
 (0)