posit-dev / posit-dev/connectapi
Provide a convenience method for filtering lists from the server
Open
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 54
- Forks
- 27
- Avg merge
- 1d 3m
- Merged PRs (30d)
- 1
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 filter this list within R is to use purrr::keep(). Perhaps this is the best way, but perhaps there's a way we can make this easier.
my_content <- search_content(client, "owner:@me")
# > length(my_content)
# [1] 237
MINIMUM_R_VERSION <- "4.0"
# Use purrr::keep to filter with arbitrary predicates
old_content <- purrr::keep(my_content, function(x) {
isTRUE(as.numeric_version(x$content$r_version) < as.numeric_version(MINIMUM_R_VERSION))
})
length(old_content)
# [1] 48
Contributor 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.
Research direction
Start by reading search_content() and issue #463 to understand the returned Connect objects. Compare the example's purrr::keep() workflow with the proposed convenience method, and confirm the expected API and completion criteria before implementation; no file or test is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100