Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Implement 'DictReader.show_warnings' functionality #367

@mpsonntag

Description

@mpsonntag

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions