You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Dragoș Moldovan-Grünfeld (Jira)" <ji...@apache.org> on 2022/07/04 12:32:00 UTC

[jira] [Updated] (ARROW-14071) [R] Try to arrow_eval user-defined functions

     [ https://issues.apache.org/jira/browse/ARROW-14071?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dragoș Moldovan-Grünfeld updated ARROW-14071:
---------------------------------------------
    Description: 
*Proposed approach*:


The first test passes but the second one fails, even though they're equivalent. The user's function isn't being evaluated in the nse_funcs environment.

{code}
  expect_dplyr_equal(
    input %>%
      select(-fct) %>%
      filter(nchar(padded_strings) < 10) %>%
      collect(),
    tbl
  )
  isShortString <- function(x) nchar(x) < 10
  expect_dplyr_equal(
    input %>%
      select(-fct) %>%
      filter(isShortString(padded_strings)) %>%
      collect(),
    tbl
  )
{code}

  was:
The first test passes but the second one fails, even though they're equivalent. The user's function isn't being evaluated in the nse_funcs environment.

{code}
  expect_dplyr_equal(
    input %>%
      select(-fct) %>%
      filter(nchar(padded_strings) < 10) %>%
      collect(),
    tbl
  )
  isShortString <- function(x) nchar(x) < 10
  expect_dplyr_equal(
    input %>%
      select(-fct) %>%
      filter(isShortString(padded_strings)) %>%
      collect(),
    tbl
  )
{code}


> [R] Try to arrow_eval user-defined functions
> --------------------------------------------
>
>                 Key: ARROW-14071
>                 URL: https://issues.apache.org/jira/browse/ARROW-14071
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: R
>            Reporter: Neal Richardson
>            Assignee: Dragoș Moldovan-Grünfeld
>            Priority: Major
>
> *Proposed approach*:
> The first test passes but the second one fails, even though they're equivalent. The user's function isn't being evaluated in the nse_funcs environment.
> {code}
>   expect_dplyr_equal(
>     input %>%
>       select(-fct) %>%
>       filter(nchar(padded_strings) < 10) %>%
>       collect(),
>     tbl
>   )
>   isShortString <- function(x) nchar(x) < 10
>   expect_dplyr_equal(
>     input %>%
>       select(-fct) %>%
>       filter(isShortString(padded_strings)) %>%
>       collect(),
>     tbl
>   )
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)