Skip to content

Commit 11bb06b

Browse files
committed
style: styler (GHA)
1 parent 732e268 commit 11bb06b

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed

R/methods-epi_archive.R

+24-23
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,8 @@ dplyr_col_modify.col_modify_recorder_df <- function(data, cols) {
10311031
#' # that point:
10321032
#' archive_cases_dv_subset %>%
10331033
#' filter(version <= time_value + as.difftime(60, units = "days"),
1034-
#' .format_aware = TRUE)
1034+
#' .format_aware = TRUE
1035+
#' )
10351036
#'
10361037
#' @export
10371038
filter.epi_archive <- function(.data, ..., .by = NULL, .format_aware = FALSE) {
@@ -1042,29 +1043,29 @@ filter.epi_archive <- function(.data, ..., .by = NULL, .format_aware = FALSE) {
10421043
} else {
10431044
out_tbl <- in_tbl %>%
10441045
filter(
1045-
# Add our own fake filter arg to the user's ..., to update the data mask
1046-
# to prevent `version` column usage.
1047-
{
1048-
# We should be evaluating inside the data mask. To disable both
1049-
# `version` and `.data$version`, we need to go to the data mask's
1050-
# ------
1051-
e <- environment()
1052-
while (!identical(e, globalenv()) && !identical(e, emptyenv())) {
1053-
if ("version" %in% names(e)) {
1054-
# "version" is expected to be an active binding, and directly
1055-
# assigning over it has issues; explicitly `rm` first.
1056-
rm(list = "version", envir = e)
1057-
delayedAssign("version", cli::cli_abort(c(
1058-
"Using `version` in `filter` may produce unexpected results.",
1059-
">" = "See if `epix_as_of` or `epix_slide` would work instead.",
1060-
">" = "If not, see `?filter.epi_archive` details for how to proceed."
1061-
)), assign.env = e)
1062-
break
1046+
# Add our own fake filter arg to the user's ..., to update the data mask
1047+
# to prevent `version` column usage.
1048+
{
1049+
# We should be evaluating inside the data mask. To disable both
1050+
# `version` and `.data$version`, we need to go to the data mask's
1051+
# ------
1052+
e <- environment()
1053+
while (!identical(e, globalenv()) && !identical(e, emptyenv())) {
1054+
if ("version" %in% names(e)) {
1055+
# "version" is expected to be an active binding, and directly
1056+
# assigning over it has issues; explicitly `rm` first.
1057+
rm(list = "version", envir = e)
1058+
delayedAssign("version", cli::cli_abort(c(
1059+
"Using `version` in `filter` may produce unexpected results.",
1060+
">" = "See if `epix_as_of` or `epix_slide` would work instead.",
1061+
">" = "If not, see `?filter.epi_archive` details for how to proceed."
1062+
)), assign.env = e)
1063+
break
1064+
}
1065+
e <- parent.env(e)
10631066
}
1064-
e <- parent.env(e)
1065-
}
1066-
TRUE
1067-
},
1067+
TRUE
1068+
},
10681069
...,
10691070
.by = .by
10701071
)

0 commit comments

Comments
 (0)