Skip to content
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

Interrogate step labels #519

Merged
merged 4 commits into from
Feb 28, 2024
Merged

Conversation

yjunechoe
Copy link
Collaborator

@yjunechoe yjunechoe commented Feb 28, 2024

A small surgery on interrogate() to:

  1. Toggle the printing of each step's label to the console output during interrogation (Show labels in console output when using interrogate() #510)
  2. Expose the internal quiet variable to let users control whether interrogate() should print to console at all (now becomes interrogate(progress = interactive()))

Also works good with glue integration from #495 !

create_agent(small_table) %>% 
  col_exists(
    columns = c(a, z),
    label = "Check that column `{.col}` exists",
    actions = action_levels(notify_at = 1)
  ) %>% 
  col_exists(
    columns = x,
    label = "`x` should really exist",
    actions = action_levels(stop_at = 1)) %>% 
  col_vals_not_null(
    columns = c:e,
    label = "Checking that {.col} is complete",
    actions = action_levels(warn_at = 1)
  ) %>% 
  interrogate(show_step_label = TRUE)
#> 
#> ── Interrogation Started - there are 6 steps ────────────────────────────────────────────────────────
#> ✔ Step 1: OK. — Check that column `a` exists
#> ! Step 2: NOTIFY condition met. — Check that column `z` exists
#> ✖ Step 3: STOP condition met. — `x` should really exist
#> ! Step 4: WARNING condition met. — Checking that c is complete
#> ✔ Step 5: OK. — Checking that d is complete
#> ✔ Step 6: OK. — Checking that e is complete
#> 
#> ── Interrogation Completed ──────────────────────────────────────────────────────────────────────────

Fixes: #510

@rich-iannone rich-iannone self-requested a review February 28, 2024 19:06
Copy link
Member

@rich-iannone rich-iannone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rich-iannone rich-iannone merged commit 19b4127 into rstudio:main Feb 28, 2024
13 checks passed
@yjunechoe yjunechoe deleted the interrogate-step-labels branch February 28, 2024 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show labels in console output when using interrogate()
2 participants