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

[R] write_* functions should invisibly return their inputs

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 0.15.1
    • 0.17.0
    • R
    • Windows 10, R 3.6.2

    Description

       

      I am wondering if you'd consider a slight change to what is returned by the write_* functions. In {readr} the write functions return its input which is very useful for saving intermediate objects within a pipeline. I'd be happy to take this on and submit as a pull request. A quick illustration:

       library(arrow)
       #> 
       #> Attaching package: 'arrow'
       #> The following object is masked from 'package:utils':
       #> 
       #> timestamp
       library(readr)
       #> 
       #> Attaching package: 'readr'
       #> The following object is masked from 'package:arrow':
       #> 
       #> read_table
      iris_arrow <- write_parquet(iris, "iris.parquet")
       iris_arrow
       #> NULL
      iris_readr <- write_csv(iris, "iris.csv")
      head(iris_readr)
       #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
       #> 1 5.1 3.5 1.4 0.2 setosa
       #> 2 4.9 3.0 1.4 0.2 setosa
       #> 3 4.7 3.2 1.3 0.2 setosa
       #> 4 4.6 3.1 1.5 0.2 setosa
       #> 5 5.0 3.6 1.4 0.2 setosa
       #> 6 5.4 3.9 1.7 0.4 setosa
      devtools::session_info()
       #> - Session info ---------------------------------------------------------------
       #> setting value 
       #> version R version 3.6.2 (2019-12-12)
       #> os Windows 10 x64 
       #> system x86_64, mingw32 
       #> ui RTerm 
       #> language (EN) 
       #> collate English_Canada.1252 
       #> ctype English_Canada.1252 
       #> tz America/Los_Angeles 
       #> date 2020-02-07 
       #> 
       #> - Packages -------------------------------------------------------------------
       #> package * version date lib source 
       #> arrow * 0.15.1.20200207 2020-02-07 [1] local 
       #> assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.6.0) 
       #> backports 1.1.5 2019-10-02 [1] CRAN (R 3.6.1) 
       #> bit 1.1-15.1 2020-01-14 [1] CRAN (R 3.6.2) 
       #> bit64 0.9-7 2017-05-08 [1] CRAN (R 3.6.0) 
       #> callr 3.4.1 2020-01-24 [1] CRAN (R 3.6.2) 
       #> cli 2.0.1 2020-01-08 [1] CRAN (R 3.6.2) 
       #> crayon 1.3.4 2017-09-16 [1] CRAN (R 3.6.0) 
       #> desc 1.2.0 2018-05-01 [1] CRAN (R 3.6.0) 
       #> devtools 2.2.1 2019-09-24 [1] CRAN (R 3.6.2) 
       #> digest 0.6.23 2019-11-23 [1] CRAN (R 3.6.1) 
       #> ellipsis 0.3.0 2019-09-20 [1] CRAN (R 3.6.1) 
       #> evaluate 0.14 2019-05-28 [1] CRAN (R 3.6.0) 
       #> fansi 0.4.1 2020-01-08 [1] CRAN (R 3.6.2) 
       #> fs 1.3.1 2019-05-06 [1] CRAN (R 3.6.0) 
       #> glue 1.3.1 2019-03-12 [1] CRAN (R 3.6.0) 
       #> highr 0.8 2019-03-20 [1] CRAN (R 3.6.0) 
       #> hms 0.5.3 2020-01-08 [1] CRAN (R 3.6.2) 
       #> htmltools 0.4.0 2019-10-04 [1] CRAN (R 3.6.1) 
       #> knitr 1.27 2020-01-16 [1] CRAN (R 3.6.2) 
       #> magrittr 1.5 2014-11-22 [1] CRAN (R 3.6.0) 
       #> memoise 1.1.0 2017-04-21 [1] CRAN (R 3.6.0) 
       #> pillar 1.4.3 2019-12-20 [1] CRAN (R 3.6.2) 
       #> pkgbuild 1.0.6 2019-10-09 [1] CRAN (R 3.6.1) 
       #> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 3.6.1) 
       #> pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.6.0) 
       #> prettyunits 1.1.1 2020-01-24 [1] CRAN (R 3.6.2) 
       #> processx 3.4.1 2019-07-18 [1] CRAN (R 3.6.1) 
       #> ps 1.3.0 2018-12-21 [1] CRAN (R 3.6.0) 
       #> purrr 0.3.3 2019-10-18 [1] CRAN (R 3.6.1) 
       #> R6 2.4.1 2019-11-12 [1] CRAN (R 3.6.1) 
       #> Rcpp 1.0.3 2019-11-08 [1] CRAN (R 3.6.1) 
       #> readr * 1.3.1 2018-12-21 [1] CRAN (R 3.6.1) 
       #> remotes 2.1.0 2019-06-24 [1] CRAN (R 3.6.1) 
       #> rlang 0.4.3 2020-01-24 [1] CRAN (R 3.6.2) 
       #> rmarkdown 2.1 2020-01-20 [1] CRAN (R 3.6.2) 
       #> rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.6.0) 
       #> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.6.0) 
       #> stringi 1.4.4 2020-01-09 [1] CRAN (R 3.6.2) 
       #> stringr 1.4.0 2019-02-10 [1] CRAN (R 3.6.2) 
       #> testthat 2.3.1 2019-12-01 [1] CRAN (R 3.6.1) 
       #> tibble 2.1.3 2019-06-06 [1] CRAN (R 3.6.2) 
       #> tidyselect 0.2.5 2018-10-11 [1] CRAN (R 3.6.2) 
       #> usethis 1.5.1.9000 2020-01-31 [1] Github (r-lib/usethis@c31336d)
       #> vctrs 0.2.2 2020-01-24 [1] CRAN (R 3.6.2) 
       #> withr 2.1.2 2018-03-15 [1] CRAN (R 3.6.0) 
       #> xfun 0.12 2020-01-13 [1] CRAN (R 3.6.2) 
       #> yaml 2.2.0 2018-07-25 [1] CRAN (R 3.6.2) 
       #> 
       #> [1] C:/Users/salbers/R/win-library/3.6
       #> [2] C:/Program Files/R/R-3.6.2/library
      

       

      Attachments

        Issue Links

          Activity

            People

              boshek Sam Albers
              boshek Sam Albers
              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 20m
                  1h 20m