Skip to content

Commit 1687d2a

Browse files
authored
Merge pull request #717 from openml/fix_608
Fixing dataset_id referenced before assignment
2 parents e2222aa + a1c33bf commit 1687d2a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

doc/progress.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Changelog
88

99
0.10.0
1010
~~~~~~
11+
* FIX #608: Fixing dataset_id referenced before assignment error in get_run function.
1112
* ADD #715: `list_evaluations` now has an option to sort evaluations by score (value).
1213
* FIX #589: Fixing a bug that did not successfully upload the columns to ignore when creating and publishing a dataset.
1314
* DOC #639: More descriptive documention for function to convert array format.

openml/runs/functions.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,13 @@ def obtain_field(xml_obj, fieldname, from_server, cast=None):
667667
dataset_id = int(run['oml:input_data']['oml:dataset']['oml:did'])
668668
elif not from_server:
669669
dataset_id = None
670+
else:
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
670677

671678
files = OrderedDict()
672679
evaluations = OrderedDict()

0 commit comments

Comments
 (0)