rstudio / rstudio/pointblank

Fail gracefully when calling info_columns when column doesn't exist

Open
#338 2 comments 0 reactions 1 assignee View on GitHub

@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

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.