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

datawizard::data_filter() throwing warning for a vignette #356

Closed
IndrajeetPatil opened this issue Mar 15, 2023 · 4 comments
Closed

datawizard::data_filter() throwing warning for a vignette #356

IndrajeetPatil opened this issue Mar 15, 2023 · 4 comments

Comments

@IndrajeetPatil
Copy link
Member

@etiennebacher Is this expected?

cf. https://github.com/easystats/easystats/actions/runs/4426547689/jobs/7762966033

Quitting from lines 32-78 (list_of_functions.Rmd) 
Error in `map()`:In index: 3.With name: vignettes/list_of_functions.Rmd.
Caused by error:
! Filtering did not work. Please check the syntax of your `filter`
  argument.
Backtrace:
 1. datawizard::data_filter(all_fns, func %in% fns)
 2. datawizard:::data_filter.data.frame(all_fns, func %in% fns)
 3. insight::format_error("Filtering did not work. Please check the syntax of your `filter` argument.")
 4. insight::format_alert(..., type = "error")
 5. base::stop(...)
@strengejacke
Copy link
Member

Cannot reproduce locally. Should we test on datawizard dev to see if this issue persists?

@etiennebacher
Copy link
Member

etiennebacher commented Mar 15, 2023

I can reproduce locally with all latest versions:

options(crayon.enabled = TRUE, warn = 2L)
vignettes <- fs::dir_ls("vignettes/", glob = "*.Rmd", recurse = TRUE)
purrr::walk(vignettes, ~rmarkdown::render(.x))

It probably comes from all the substitute + eval in data_filter(), it's not the first time it causes problems in actions

@etiennebacher
Copy link
Member

etiennebacher commented Mar 15, 2023

Reprex:

  • save this in "reprex.Rmd" in "vignettes"
---
output: rmarkdown::html_document
---

```{r}
dat <- data.frame() # dataset doesn't matter here
test <- c("a", "b", "c")
x <- "a"

data_filter(dat, x %in% test)
```
  • remove all objects from global env
  • run lapply("vignettes/reprex.Rmd", rmarkdown::render)

@IndrajeetPatil
Copy link
Member Author

Closing in favour of easystats/datawizard#379

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants