Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement 'DictReader.show_warnings' functionality #367

Closed
mpsonntag opened this issue Mar 12, 2020 · 0 comments · Fixed by #386
Closed

Implement 'DictReader.show_warnings' functionality #367

mpsonntag opened this issue Mar 12, 2020 · 0 comments · Fixed by #386
Assignees

Comments

@mpsonntag
Copy link
Contributor

When reading an XML odml file, the XMLReader features a show_warnings attribute allowing to parse even invalid odml documents. When show_warnings on an XMLReader is true and an invalid odml document is parsed from an XML file, all errors that occur are converted into warnings, all offending values are discarded and the collected warnings are printed after the valid document content has been parsed. This enables to load and fix odml documents that feature minor validity problems.

The DictReader in odml/tools/dict_parser.py used to parse JSON or YAML odml files also features a show_warnings attribute, but up to this point the corresponding functionality to enable loading invalid documents has not been implemented.

Both loading invalid JSON and YAML files via the DictReader with attribute show_warnings=True should be similar to the XMLReader behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant