Skip to content

Commit

Permalink
add bool type; remove call to debugger and raise exception on unexpec…
Browse files Browse the repository at this point in the history
…ted kind from jsonl
  • Loading branch information
jpgard committed Feb 14, 2024
1 parent 4553f8c commit 6ff4979
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tableshift/core/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,13 @@ def from_jsonl(cls, file: str, auto_cast_value_mappings: bool = False):

for i in range(len(feature_dicts)):
kind = feature_dicts[i]['kind']
if kind in ('float', 'int'):
if kind in ('float', 'int', 'bool'):
feature_dicts[i]['kind'] = eval(kind)
elif kind == "category":
feature_dicts[i]['kind'] = cat_dtype
else:
print(f"unexpected kind: {kind}")
import ipdb;
ipdb.set_trace()
raise ValueError(f"unexpected kind: {kind}")

features = [Feature(**feature_dict) for feature_dict in feature_dicts]
return cls(features=features)

Expand Down

0 comments on commit 6ff4979

Please sign in to comment.