Make it easier to apply existing `Content` functions to lists of content
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Read issue #463's change to search_content() and inspect the existing functions that operate on Content objects; no file or test is named here. Define how list inputs and additional arguments should behave, then verify that calls such as lock_content(old_content, locked_message = "R version is too old.") match the purrr::map() result.
Written by the indexing model from the issue text.
Description
#463 (in flight at time of writing) modifies search_content() to return a list of Connect class objects.
Right now, the best way to call existing functions that operate on Content class objects is to use purrr::map(). This is pretty simple if there are no additional arguments passed, but if additional args were required, you'd have to use R's anonymous function syntax.
# Assume `old_content` is a list of content class objects that need to be locked.
length(old_content)
# [1] 48
# Use purrr::map to apply existing functions to the list.
old_content <- purrr::map(old_content, lock_content)
# When passing extra args
old_content <- purrr::map(old_content, \(x) lock_content(x, locked_message = "R version is too old."))
It would be nicer if you could just pass the list to the functions and have it work, like so:
old_content <- lock_content(old_content, locked_message = "R version is too old.")
This might require us modifying all the content functions.
- Dominant language
- R
- Stars
- 54
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from posit-dev/connectapi
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
posit-dev/connectapi#249 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
posit-dev/connectapi#527 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
posit-dev/connectapi#526 · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
posit-dev/connectapi#506 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
posit-dev/connectapi#486 ·
All issues in posit-dev/connectapi
Similar issues
-
bug priority: should
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
The-Strategy-Unit/nhp_outputs#477 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Open-Systems-Pharmacology/OSPSuite.ReportingEngine#1380 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Open-Systems-Pharmacology/OSPSuite.ParameterIdentification#335 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100