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

Clean up evaluation error tooltips in agent report #543

Merged
merged 6 commits into from
Jun 28, 2024

Conversation

yjunechoe
Copy link
Collaborator

Summary

This is a minor QoL visual change to the contents of the tooltip text for evaluation errors in the agent report.

df <- data.frame(date = "invalid date")
agent <- create_agent(df) |> 
  col_vals_equal(date, Sys.Date()) |> 
  interrogate(progress = TRUE)
#> 
#> ── Interrogation Started - there is a single validation step ───────────────────
#> ℹ Step 1: an evaluation issue requires attention (ERROR).
#> 
#> ── Interrogation Completed ─────────────────────────────────────────────────────

Before:

image

After:

image

Note that the error object with the full context is still available in $capture_stack$error, if one wanted to diagnose it more seriously.


Implementational details:

  1. validation_set$capture_stack now tracks an additional information about the call passed to pointblank_try_catch(), in $pb_call:

    agent$validation_set$capture_stack[[1]]$pb_call
    #> tbl_val_comparison(table = table, column = column, operator = operator, 
    #>     value = value, na_pass = na_pass)

    Two unit tests were updated to reflect this change to the contents of $capture_stack.

  2. This information about the pointblank-internal call lays dormant in the agent, and is only consumed at get_agent_report() as part of formatting the error objects to string before rendering to html <title>. This is handled by a new internal function pointblank_cnd_to_string().

Note that warning objects turned out to be are somewhat more complicated to work with, so the reformatting currently only applies to errors.

@rich-iannone rich-iannone self-requested a review June 28, 2024 13:29
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.

This is great, thanks!

@rich-iannone
Copy link
Member

@yjunechoe Feel free to merge this in at your leisure!

@yjunechoe yjunechoe merged commit 220eb8c into rstudio:main Jun 28, 2024
12 checks passed
@yjunechoe yjunechoe deleted the agent-report-eval-text-fmt branch August 7, 2024 00:08
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.

2 participants