Skip to content

Commit

Permalink
force record id to be a string
Browse files Browse the repository at this point in the history
  • Loading branch information
GreatYYX committed Mar 22, 2018
1 parent bcc0cf0 commit 400cce7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rltk/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def build_index(self):
raise ValueError('Reader or Record class is not provided.')
for raw_object in self._reader:
record_instance = self._record_class(raw_object)
if not isinstance(record_instance.id, str):
raise ValueError('Id in record should be in string (utf-8 encoded) type.')
self._adapter.set(record_instance.id, record_instance)

def get_record(self, record_id):
Expand Down

0 comments on commit 400cce7

Please sign in to comment.