Skip to content

Commit

Permalink
fixed string check with python 2 compatible code
Browse files Browse the repository at this point in the history
  • Loading branch information
janvanrijn committed Mar 27, 2017
1 parent 7de99ff commit 900676a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions openml/datasets/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import scipy.sparse
import xmltodict

from builtins import str
from .data_feature import OpenMLDataFeature
from ..exceptions import PyOpenMLError

Expand Down Expand Up @@ -65,14 +66,14 @@ def __init__(self, dataset_id=None, name=None, version=None, description=None,
self.default_target_attribute = default_target_attribute
self.row_id_attribute = row_id_attribute
self.ignore_attributes = None
if type(ignore_attribute) == str:
if isinstance(ignore_attribute, str):
self.ignore_attributes = [ignore_attribute]
elif type(ignore_attribute) == list:
elif isinstance(ignore_attribute, list):
self.ignore_attributes = ignore_attribute
elif ignore_attribute is None:
pass
else:
raise ValueError('wrong data type for ignore_attribute. Should be list (or string). ')
raise ValueError('wrong data type for ignore_attribute. Should be list. ')
self.version_label = version_label
self.citation = citation
self.tag = tag
Expand Down

0 comments on commit 900676a

Please sign in to comment.