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

output_results_excel writes a corrupted excel file #56

Closed
g-hyo opened this issue Oct 20, 2021 · 1 comment
Closed

output_results_excel writes a corrupted excel file #56

g-hyo opened this issue Oct 20, 2021 · 1 comment
Assignees
Labels
Task: Bug Something isn't working

Comments

@g-hyo
Copy link

g-hyo commented Oct 20, 2021

Just ran into this with GOS.

x <- test_dir(full_path, stop_on_failure = FALSE, stop_on_warning = FALSE)

res_path <- paste0(full_path, "/results_pop_final_clean.xlsx")
output_results_excel(x, res_path)

One of the base checks had a reference to E386 which is no longer in the data. This resulted in the base check spitting out an error:

`Problem with `mutate()` input `..1`. �[31mx�[39m object 'E386' not found �[34mi�[39m Input `..1` is `!E386 %in% c(NA, "", 9)`.`

test_dir didn't actually stop due to this error, and the output produced is a corrupted excel file with a blank sheet like so
image

Obviously there should be no errors in the first place when running unit tests, but it could be useful to still be able to access the output somehow to quickly diagnose the issue. In a CSV, the error is output.
image

We could also just have it such that output_results_excel spits an error and doesn't run if there are any errors in the tests (probably the simplest solution)

@gorcha gorcha added the Task: Bug Something isn't working label Oct 31, 2021
@kinto-b
Copy link
Contributor

kinto-b commented Nov 24, 2021

Looks like a character encoding issue. The tidyverse uses UTF-8 characters and applies colouring to their error messages. It would appear that this doesn't play nicely with whatever encoding openxlsx uses.

We can resolve simply by removing non-printable ascii characters from the description. @gorcha How does that sound to you?

kinto-b pushed a commit that referenced this issue Jan 5, 2022
Certain non-printable characters produced in R error messages were corrupting the excel output
kinto-b pushed a commit that referenced this issue Jan 5, 2022
Certain non-printable characters produced in R error messages were corrupting the excel output
@kinto-b kinto-b self-assigned this Jan 5, 2022
@kinto-b kinto-b closed this as completed in 0238ac8 Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Task: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants