Skip to content

Commit

Permalink
move extraction of used columns into interrogate
Browse files Browse the repository at this point in the history
  • Loading branch information
yjunechoe committed Sep 12, 2024
1 parent 8287cc4 commit 7f30dc5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 1 addition & 5 deletions R/col_vals_expr.R
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,6 @@ col_vals_expr <- function(
}
}

# Extract columns from expr
data_cols <- colnames(apply_preconditions_for_cols(x, preconditions))
columns <- all_data_vars(expr, data_cols)

# Resolve segments into list
segments_list <-
resolve_segments(
Expand Down Expand Up @@ -404,7 +400,7 @@ col_vals_expr <- function(
assertion_type = "col_vals_expr",
i_o = i_o,
columns_expr = NA_character_,
column = columns,
column = NA_character_,
values = expr,
preconditions = preconditions,
seg_expr = segments,
Expand Down
7 changes: 7 additions & 0 deletions R/interrogate.R
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,13 @@ interrogate <- function(
assertion_type = assertion_type
)

if (assertion_type == "col_vals_expr") {
# Extract columns from expr and update validation set with used columns
expr <- get_values_at_idx(agent = agent, idx = i)[[1]]
columns <- all_data_vars(expr, data_cols = colnames(table))
agent$validation_set[[i, "column"]] <- list(columns)
}

} else if (assertion_type == "conjointly") {

validation_formulas <- get_values_at_idx(agent = agent, idx = i)
Expand Down

0 comments on commit 7f30dc5

Please sign in to comment.