Skip to content

Commit d3d9cee

Browse files
authored
Merge pull request #401 from openml/dataupload
data upload
2 parents 2fffbcd + 8aca0bd commit d3d9cee

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

openml/datasets/dataset.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def __init__(self, dataset_id=None, name=None, version=None, description=None,
121121
with open(self.data_pickle_file, "wb") as fh:
122122
pickle.dump((X, categorical, attribute_names), fh, -1)
123123
logger.debug("Saved dataset %d: %s to file %s" %
124-
(self.dataset_id, self.name, self.data_pickle_file))
124+
(int(self.dataset_id or -1), self.name, self.data_pickle_file))
125125

126126
def push_tag(self, tag):
127127
"""Annotates this data set with a tag on the server.
@@ -446,7 +446,11 @@ def _to_xml(self):
446446
for prop in props:
447447
content = getattr(self, prop, None)
448448
if content is not None:
449-
xml_dataset += "<oml:{0}>{1}</oml:{0}>\n".format(prop, content)
449+
if isinstance(content, (list,set)):
450+
for item in content:
451+
xml_dataset += "<oml:{0}>{1}</oml:{0}>\n".format(prop, item)
452+
else:
453+
xml_dataset += "<oml:{0}>{1}</oml:{0}>\n".format(prop, content)
450454
xml_dataset += "</oml:data_set_description>"
451455
return xml_dataset
452456

0 commit comments

Comments
 (0)