-
Notifications
You must be signed in to change notification settings - Fork 4k
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 ability to specify a yaml file as parameters #8133
base: v2
Are you sure you want to change the base?
Conversation
result = yaml.load(check_val) | ||
# Yaml parsing is only supported for yaml list documents as there are currently no | ||
# known use cases for yaml map documents | ||
if isinstance(result, list): |
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.
Wasn't sure if there was a use case for dictionary yaml documents. Let me know if you guys want to support it.
Codecov Report
@@ Coverage Diff @@
## v2 #8133 +/- ##
==========================================
- Coverage 93.12% 93.11% -0.01%
==========================================
Files 363 363
Lines 38291 38308 +17
Branches 6127 6130 +3
==========================================
+ Hits 35657 35670 +13
- Misses 1963 1968 +5
+ Partials 671 670 -1
|
I just realized there's another PR that aims to achieves something similar #5482 but with a different approach. Up to you guys which approach you want to choose. |
One drawback of my approach is that it's difficult to provide useful error messages; It's difficult to determine whether the argument passed in is an invalid yaml document or shorthand or JSON - since we try and parse the full yaml document. Alternatives might be:
These would allow better error messages |
The more I think about it, the more file extension based matching makes more sense. Let me know if you want me to redo this PR |
*Issue #2275
Screencast.from.25-08-23.18.45.15.webm
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.