Skip to content

[R] str_replace with NA does not match stringr behavior #33432

Description

@asfimport
q <- data.table(x=c('','1','2'))
q %>% write_dataset('q')

#in R

q %>% mutate(x2=x %>% str_replace('^
s*$',NA_character_))

   x   x2
1:   <NA>
2: 1    1
3: 2    2

#in arrow

q2 <- 'q' %>% open_dataset %>% mutate(x2=x %>% str_replace('^
s*$',NA_character_)) %>% collect

q2

   x x2
1:     
2: 1  1
3: 2  2

Reporter: Lucas Mation / @lucasmation

Related issues:

Note: This issue was originally created as ARROW-18250. Please see the migration documentation for further details.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions