-
Notifications
You must be signed in to change notification settings - Fork 0
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
List as is #33
List as is #33
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #33 +/- ##
==========================================
+ Coverage 97.96% 98.07% +0.10%
==========================================
Files 9 10 +1
Lines 591 622 +31
==========================================
+ Hits 579 610 +31
Misses 12 12 ☔ View full report in Codecov by Sentry. |
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.
lgtm!
And thank you for the in-depth description of the PR, will be very helpful in case we ever need to look at this in the future :-)
This PR adds functions to modify lists, given a path in the list. That is, given a list (preferably, but not necessarily named) and a
position
, you can apply a function to a given element. So withposition = c("a", "b", "c")
, the function would apply whatever function is provided tox$a$b$c
and no other elements (thematically related to, but very different frompurrr::map_depth
).Motivation: While working on a feature to handle multiple files in
workflow.pacta
, the param parsing function was throwing errors when checking that the params still validate against the schema after inheriting defaults.The issue was that
files
was being specified as an array, but with the new schema,jsonlite::toJSON(..., auto_unbox = TRUE)
was casting length-1 vectors as scalars (the behavior we want for almost everything else). To correct that issue, we need to mark thefiles
entity asAs-Is
, using theI()
function. The new functions in this PR allow that to happen.