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

[R] arrow::read_csv_arrow namespace error when package not loaded #22725

Closed
asfimport opened this issue Aug 24, 2019 · 4 comments
Closed

[R] arrow::read_csv_arrow namespace error when package not loaded #22725

asfimport opened this issue Aug 24, 2019 · 4 comments
Assignees
Milestone

Comments

@asfimport
Copy link
Collaborator

I am not sure if the arrow::read_csv_arrow() error below is a bug or a feature?

data("iris")
write.csv(iris, "iris.csv")
test <- arrow::read_csv_arrow("iris.csv")
Error in read_delim_arrow(file = "iris.csv", delim = ",") :
could not find function "read_delim_arrow"
test <- arrow::read_delim_arrow("iris.csv")
sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-apple-darwin18.6.0 (64-bit)
Running under: macOS Mojave 10.14.6
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /usr/local/Cellar/openblas/0.3.7/lib/libopenblasp-r0.3.7.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets
[6] methods base

loaded via a namespace (and not attached):
[1] tidyselect_0.2.5 bit_1.1-14 compiler_3.6.1
[4] magrittr_1.5 assertthat_0.2.1 R6_2.4.0
[7] tools_3.6.1 fs_1.3.1 glue_1.3.1
[10] Rcpp_1.0.2 bit64_0.9-7 arrow_0.14.1.1
[13] rlang_0.4.0 purrr_0.3.2

Reporter: Hugh Miles
Assignee: Neal Richardson / @nealrichardson

PRs and other links:

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

@asfimport
Copy link
Collaborator Author

Neal Richardson / @nealrichardson:
It's a namespace issue. That shouldn't error and I can make it work, but you can solve this now by just loading library(arrow):

> write.csv(iris, "iris.csv")
> test <- arrow::read_csv_arrow("iris.csv")
Error in read_delim_arrow(file = "iris.csv", delim = ",") : 
  could not find function "read_delim_arrow"
> library(arrow)

Attaching package:arrowThe following object is masked frompackage:utils:

    timestamp

> test <- read_csv_arrow("iris.csv")
> head(test)
        Sepal.Length Sepal.Width Petal.Length Petal.Width    Species
1     1          5.1         3.5          1.4         0.2     setosa
2     2          4.9         3.0          1.4         0.2     setosa
3     3          4.7         3.2          1.3         0.2     setosa
4     4          4.6         3.1          1.5         0.2     setosa
5     5          5.0         3.6          1.4         0.2     setosa
6     6          5.4         3.9          1.7         0.4     setosa

@asfimport
Copy link
Collaborator Author

Hugh Miles:
I am now having a slightly different error.. appears to be caused by "~/"?

library("arrow")
data("iris")
write.csv(iris, "/iris.csv", row.names = FALSE)
test1 <- arrow::read_csv_arrow("
/iris.csv")
Error in io___MemoryMappedFile__Open(fs::path_abs(path), mode) :
IOError: Failed to open local file '/iris.csv', error: No such file or directory
test2 <- read.csv("
/iris.csv")

@asfimport
Copy link
Collaborator Author

Neal Richardson / @nealrichardson:
Yeah, I hit that last week too. Will be fixed by ARROW-6323. You can work around in the meantime by using normalizePath() if you have a tilde in your file path.

@asfimport
Copy link
Collaborator Author

Wes McKinney / @wesm:
Issue resolved by pull request 5223
#5223

@asfimport asfimport added this to the 0.15.0 milestone Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants