base pipe does not work inside `preconditions`
Open
Nobody has claimed this yet.
Difficulty: [2] Intermediate
Effort: [2] Medium
Priority: [3] High
Type: ☹︎ Bug
- Dominant language
- R
- Stars
- 1k
- Forks
- 59
- Avg merge
- 25m
- Merged PRs (30d)
- 4
Description
This works:
tbl <-
dplyr::tibble(
a = c(5, 7, 6, 5, 8, 7),
b = c(7, 1, 0, 0, 8, 3),
c = c(1, 1, 1, 3, 3, 3)
)
tbl |>
create_agent() |>
rows_complete(
columns = vars(a, b),
preconditions = ~ . %>% dplyr::filter(a < 10),
segments = b ~ c("group_1", "group_2"),
actions = action_levels(warn_at = 0.1, stop_at = 0.2),
label = "The `rows_complete()` step.",
active = TRUE
) |>
interrogate()
This fails:
tbl |>
create_agent() |>
rows_complete(
columns = vars(a, b),
preconditions = ~ . |> dplyr::filter(a < 10),
segments = b ~ c("group_1", "group_2"),
actions = action_levels(warn_at = 0.1, stop_at = 0.2),
label = "The `rows_complete()` step.",
active = TRUE
) |>
interrogate()
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the implementation of rows_complete() and its preconditions handling, then compare how the %>% and |> examples are evaluated. Confirm the failing reproduction and investigate the pipe expression inside the precondition; done means the base-pipe example completes through interrogate() as the magrittr-pipe example does.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100