Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-14712

[R] compare_dplyr_error() too strict

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 7.0.0
    • R

    Description

      dplyr errors are about to be updated and so the mechanism used by compare_dplyr_error() fails:

      I'm seeing this on the revdeps :

      ══ Failed tests ════════════════════════════════════════════════════════════════
      ── Error (test-dplyr-filter.R:263:3): filter environment scope ─────────────────
      Error in `lapply(args, function {
      if (!inherits(x, "Expression")){{{}

      { x <- Expression$scalar(x) }

      {}}}x
      })`: object 'b_var' not found
      Backtrace:

      1. ├─arrow:::expect_dplyr_error(input %>% filter(chr == b_var), tbl) at test-dplyr-filter.R:263:2
      2. │ ├─testthat::expect_error(...) at tests/testthat/helper-expectation.R:158:2
      3. │ │ └─testthat:::expect_condition_matching(...)
      4. │ │ └─testthat:::quasi_capture(...)
      5. │ │ ├─testthat .capture(...)
      6. │ │ │ └─base::withCallingHandlers(...)
      7. │ │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
      8. │ └─rlang::eval_tidy(expr, rlang::new_data_mask(rlang::env(input = record_batch(tbl))))
      9. ├─input %>% filter(chr == b_var)
      10. ├─dplyr::filter(., chr == b_var)
      11. └─arrow:::filter.ArrowTabular(., chr == b_var)
      12. └─base::lapply(filts, arrow_eval, arrow_mask(.data))
      13. └─arrow FUN(X[[i]], ...)
      14. └─base::tryCatch(...)
      15. └─base tryCatchList(expr, classes, parentenv, handlers)
      16. └─base tryCatchOne(expr, names, parentenv, handlers[[1L]])
      17. └─value[[3L]](cond)[ FAIL 1 | WARN 3 | SKIP 58 | PASS 5783 ]
      Error: Test failures
      Execution halted1 error x | 0 warnings ✓ | 1 note x

       

      here's a reprex showing what's happening: 

      ``` r
      library(dplyr, warn.conflicts = FALSE)
      library(arrow, warn.conflicts = FALSE)E <- function(expr) { tryCatch(expr, error = function(cnd) print(cnd, backtrace = FALSE))}{}tbl <- tibble::tibble(
        chr = letters[c(1:5, NA, 7:10)]
      )E(
        tbl %>% 
          filter(chr == b_var)
      )
      #> <error/rlang_error>
      #> Error in `filter()`:
      #>   Problem while computing `..1 = chr == b_var`.
      #> Caused by error:
      #>   object 'b_var' not found
      E(
        record_batch(tbl) %>% 
          filter(chr == b_var)
      )
      {{#> <simpleError in lapply(args, function {    if (!inherits(x, "Expression"))

      {        x <- Expression$scalar(x)    }

         x}): object 'b_var' not found>}}
      ```<sup>Created on 2021-11-15 by the [reprex package](https://reprex.tidyverse.org) (v2.0.1.9000)</sup>

      Attachments

        Issue Links

          Activity

            People

              romainfrancois Romain Francois
              romainfrancois Romain Francois
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m