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

Add handling of empty YAML in codecs.load_all_yaml #31

Merged
merged 1 commit into from
Apr 21, 2022

Conversation

ca-scribner
Copy link
Collaborator

Updates load_all_yaml() to handle empty documents in the yaml stream. For example, load_all_yaml("---\n---") would previously raise with an TypeError as it tried to iterate on the keys in the empty (but valid) YAML document that resolved to a None object. This update skips any empty (None) objects.

Also adds tests for this case.

Updates load_all_yaml() to handle empty documents in the yaml stream.  For example, load_all_yaml("---\n---") would previously raise with an TypeError as it tried to iterate on the keys in the empty (but valid) YAML document that resolved to a None object.  This update skips any empty (None) objects.

Also adds tests for this case.
@ca-scribner
Copy link
Collaborator Author

For background, this came about when rendering batches of yaml files, some of which might intentionally have some empty documents in the middle

@gtsystem
Copy link
Owner

Looks good

@gtsystem gtsystem merged commit 0328fdf into gtsystem:master Apr 21, 2022
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 this pull request may close these issues.

2 participants