Closed pbulsink closed 6 months ago
Attention: Patch coverage is 89.79592%
with 10 lines
in your changes are missing coverage. Please review.
Project coverage is 93.95%. Comparing base (
0041c82
) to head (5496bbc
).:exclamation: Current head 5496bbc differs from pull request most recent head 1a20e27. Consider uploading reports for the commit 1a20e27 to get more accurate results
Files | Patch % | Lines |
---|---|---|
R/load_laps.R | 50.00% | 2 Missing :warning: |
R/load_constructors.R | 50.00% | 1 Missing :warning: |
R/load_drivers.R | 93.75% | 1 Missing :warning: |
R/load_pitstops.R | 50.00% | 1 Missing :warning: |
R/load_quali.R | 94.11% | 1 Missing :warning: |
R/load_results.R | 83.33% | 1 Missing :warning: |
R/load_schedule.R | 97.36% | 1 Missing :warning: |
R/load_sprint.R | 50.00% | 1 Missing :warning: |
R/load_standings.R | 50.00% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@SCasanova still need to validate code works with no internet connection. Seems like there's not a really easy way of specifying it in test without adding code switches (see https://community.rstudio.com/t/unit-testing-for-non-working-internet-connection/31894 or https://blog.r-hub.io/2023/01/23/code-switch-escape-hatch-test/ ).
Per the request from CRAN and closes #228: this should now fail gracefully (return NULL) for any Ergast function if there's a connection/internet issue, and the code has been abstracted to be more general. It will also display a message with the failure to get Ergast data.
Previous behaviour was to fail with a warning (against CRAN policy) and harder-coded data manipulation wasn't flexible against small changes in results returned. This should be more forgiving now.
Notable adds:
add_col_if_absent(data, column, na_type)
- a new function that adds a column of specifiedNA_type_
(or genericNA
) to a data.frame (or higher abstract) if it's absent. Returns the data.frame as atibble
. Has no effect if thecolumn
is already present.