Fail gracefully when calling info_columns when column doesn't exist
Open
@rich-iannone is already working on this.
Since Jul 15, 2021.
Difficulty: [2] Intermediate
Effort: [3] High
Priority: ♨︎ Critical
Type: ★ Enhancement
- Dominant language
- R
- Stars
- 1k
- Forks
- 59
- Avg merge
- 25m
- Merged PRs (30d)
- 4
Description
Prework
- Read and abide by pointblank's code of conduct and contributing guidelines.
- Search for duplicates among the existing issues (both open and closed).
Proposal
It would be nice to have the active parameter in info_columns() so that it no longer fails when trying to document a missing column. Here is a small example that explains the problem, what the potential feature might look like, and what I am doing now in the mean time:
library(pointblank)
# this issue
small_table %>%
info_columns(
column = "j",
info = "foo bar"
)
# potential feature, add agent semantics to informant
small_table %>%
info_columns(
column = vars("j"),
info = "foo bar",
active = ~ . %>% has_columns(vars(j))
)
# what i am doing now
small_table %>%
tryCatch(
expr = {
info_columns(
column = "j",
info = "foo bar"
)
}, error = function(e) .
)
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.
Assessment
This issue has not been assessed yet.