Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions openml/datasets/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,13 +373,17 @@ def get_features_by_type(self, data_type, exclude=None,
result : list
a list of indices that have the specified data type
'''
assert data_type in OpenMLDataFeature.LEGAL_DATA_TYPES, "Illegal feature type requested"
if data_type not in OpenMLDataFeature.LEGAL_DATA_TYPES:
raise TypeError("Illegal feature type requested")
if self.ignore_attributes is not None:
assert type(self.ignore_attributes) is list, "ignore_attributes should be a list"
if not isinstance(self.ignore_attributes, list):
raise TypeError("ignore_attributes should be a list")
if self.row_id_attribute is not None:
assert type(self.row_id_attribute) is str, "row id attribute should be a str"
if not isinstance(self.row_id_attribute, six.string_types):
raise TypeError("row id attribute should be a str")
if exclude is not None:
assert type(exclude) is list, "Exclude should be a list"
if not isinstance(exclude, list):
raise TypeError("Exclude should be a list")
# assert all(isinstance(elem, str) for elem in exclude), "Exclude should be a list of strings"
to_exclude = []
if exclude is not None:
Expand Down