Skip to content

[Bug]: warning_append causing failure to save report #95

@Shedimus

Description

@Shedimus

Guidelines

  • I agree to follow this project's Contributing Guidelines.

Project Version

No response

Platform and OS Version

No response

Existing Issues

No response

What happened?

Trying to force a validation check to result in a warning not an error is causing the save_report function to fail with:

Error in purrr::map():
ℹ In index: 1.
Caused by error in purrr::map():
ℹ In index: 1.
Caused by error in purrr::map():
ℹ In index: 1.
Caused by error in checkHT():
! argument "df_error_head_n" is missing, with no default
Backtrace:

  1. params$generate_report_html(params$extra_params)
  2. data.validator:::display_results(...)
  3. data.validator:::make_accordion_element(...)
  4. data.validator:::result_table(results, type, mark, df_error_head_n)
  5. purrr::map(...)
    ...
  6. purrr::map(...)
  7. purrr:::map_("list", .x, .f, ..., .progress = .progress)
  8. data.validator (local) .f(.x[[i]], ...)
  9. utils (local) head.data.frame(error$error_df[[1]][[.x]], n = df_error_head_n)
  10. utils:::checkHT(n, d <- dim(x))

Quitting from lines 12-13 [generate_report] (skeleton.Rmd)

Steps to reproduce

Taking minimal example from the repo:

library(dplyr)
library(assertr)
library(data.validator)

validator <- data_validation_report()
validate(mtcars) %>%
  validate_cols(description = "vs and am values should equal 3 or 4", skip_chain_opts = TRUE,
                error_fun = warning_append, in_set(c(3, 4)), gear, carb) %>%
 add_results(validator)

get_results(validator)

save_report(validator)
browseURL("validation_report.html")

Expected behavior

Should render the report in html

Attachments

No response

Screenshots or Videos

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions