Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
Fixed AttributeError if a field's type is not supported (#358)
Browse files Browse the repository at this point in the history
  • Loading branch information
roll committed Apr 24, 2020
1 parent 7de3c50 commit 88af7cd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def read(*paths):
'simpleeval>=0.9',
'statistics>=1.0',
'tabulator>=1.29',
'tableschema>=1.16',
'tableschema>=1.16.1',
'datapackage>=1.10',
]
INSTALL_FORMAT_ODS_REQUIRES = [
Expand Down
13 changes: 13 additions & 0 deletions tests/test_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,3 +431,16 @@ def test_validate_fails_with_wrong_encoding_issue_274(log):
# For now, by default encoding is detected incorectly by chardet
report = validate('data/encoding-274.csv', encoding='utf-8')
assert report['valid']


def test_validate_invalid_table_schema_issue_304(log):
source = [
['name', 'age'],
['Alex', '33'],
]
schema = {'fields': [
{'name': 'name'},
{'name': 'age', 'type': 'bad'},
]}
report = validate(source, schema=schema)
assert not report['valid']

0 comments on commit 88af7cd

Please sign in to comment.