Skip to content

Commit

Permalink
fixed a bug with yaml parser (yamale 2.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkowalleck committed Jun 20, 2020
1 parent 0f1927a commit 95327c4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ignore =
# ignore `self`, `cls` markers of flake8-annotations>=2.0
ANN101,ANN102

exclude = .git,__pycache__,_OLD,_TEST,build,dist,.tox,*_cache,.eggs
exclude = .git,__pycache__,_OLD,_TEST,build,dist,.tox,*_cache,.eggs,.venv,venv
setup.py
docs
examples
Expand Down
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

add upcoming unreleased modiications here

## 2.4.2

* Fixed
* config yaml parser when `yamale>=2.1` is installed.

## 2.4.1

* Fixed
Expand Down
3 changes: 2 additions & 1 deletion nichtparasoup/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def parse_yaml_file(file_path: str) -> Dict[str, Any]:
if not _schema:
_schema = yamale.make_schema(_SCHEMA_FILE, parser='ruamel')
_data = yamale.make_data(file_path, parser='ruamel')
config = yamale.validate(_schema, _data, strict=True)[0][0] # type: Dict[str, Any]
yamale.validate(_schema, _data, strict=True)
config = _data[0][0] # type: Dict[str, Any]
config.setdefault('logging', dict())
config['logging'].setdefault('level', 'INFO')
for config_crawler in config['crawlers']:
Expand Down

0 comments on commit 95327c4

Please sign in to comment.