YAML documentation, test, and readability improvements#63158
Open
rhansen wants to merge 14 commits into
Open
Conversation
a3c3363 to
4720b86
Compare
8 tasks
4720b86 to
e6265db
Compare
e6265db to
6e8015f
Compare
Contributor
Author
|
friendly ping @Ch3LL |
Ch3LL
reviewed
Jan 9, 2023
Ch3LL
left a comment
Contributor
There was a problem hiding this comment.
I have a few questions. I'm also going to reach out to someone else as I'm not intimately familiar with this part of the code.
|
|
||
|
|
||
| class IndentMixin(Dumper): | ||
| """ |
Contributor
There was a problem hiding this comment.
We cannot remove a class without properly deprecating it.
whytewolf
reviewed
Jan 9, 2023
| # | ||
| # TODO: Why does this registration exist? Isn't it better to raise an | ||
| # exception for unsupported types? | ||
| D.add_representer(None, represent_undefined) |
Collaborator
There was a problem hiding this comment.
This representer is only meant for the SafeOrderedDumper not the OrderedDumper. because it is meant to be "safe" alternative to blowing up aka throwing an exception. the OrderedDumper SHOULD blowup on unknown types but SafeOrderedDumper should just null gracefully.
twangboy
previously approved these changes
Jan 10, 2023
twangboy
previously approved these changes
Jun 30, 2026
I believe the behavior changed with commit 002aa88 which was first released in Salt v2018.3.0.
This demonstrates that saltstack#12161 has already been fixed (thanks to Python 3.6 changing `dict` to iterate in insertion order).
This does not change the behavior, but it does simplify the code.
The same YAML value can be represented in different ways, so tests that compare a generated YAML string with a manually typed string are fragile. Use `salt.utils.yaml` to generate the reference YAML so that the implementation of the YAML dumper can change without breaking the tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR contains just the (hopefully non-controversial) cleanup commits from #62932.
What issues does this PR fix or reference?
#12161 (can be closed even without this PR because the bug no longer exists, although this PR adds a regression test in the form of an integration test)
Also see PR #62932.
Behavior Changes
No changes, just cleanups.
Merge requirements satisfied?
Commits signed with GPG?
No