-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
YAML documentation, test, and readability improvements #63158
base: master
Are you sure you want to change the base?
Conversation
a3c3363
to
4720b86
Compare
4720b86
to
e6265db
Compare
e6265db
to
6e8015f
Compare
friendly ping @Ch3LL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -31,17 +31,6 @@ | |||
] | |||
|
|||
|
|||
class IndentMixin(Dumper): | |||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot remove a class without properly deprecating it.
# | ||
# TODO: Why does this registration exist? Isn't it better to raise an | ||
# exception for unsupported types? | ||
D.add_representer(None, represent_undefined) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
Need to fix the pre-commit failures |
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