wjones127 commented on PR #13577:
URL: https://github.com/apache/arrow/pull/13577#issuecomment-1181856644

   > Just wondering: to what extent is this a corner case that just happens to 
be in our tests, or is there a practical value in allowing trailing slashes?
   
   I'm not sure yet what else relies on that. In R, it's just that we pass 
`fs$path("some/path")` to functions like `write_parquet()`. `fs$path()` returns 
a `SubTreeFilesystem`, which I think is just used as a convenient way to pass a 
path (as the base path) and a filesystem in one object. But as a side effect of 
using `base_path` to transmit the path, we add a trailing slash. Using this 
method fails for `LocalFileSystem` though:
   
   ``` r
   library(arrow)
   #> 
   #> Attaching package: 'arrow'
   #> The following object is masked from 'package:utils':
   #> 
   #>     timestamp
   
   example_data <- arrow_table(x = Array$create(c(1, 2, 3)))
   
   fs <- LocalFileSystem$create()
   write_parquet(example_data, fs$path("test.parquet"))
   #> Error: IOError: Failed to open local file 'test.parquet/'
   #> 
/Users/willjones/Documents/arrows/arrow/cpp/src/arrow/filesystem/localfs.cc:442 
 ::arrow::internal::FileOpenWritable(fn, write_only, truncate, append). Detail: 
[errno 2] No such file or directory
   ```
   
   <sup>Created on 2022-07-12 by the [reprex 
package](https://reprex.tidyverse.org) (v2.0.1)</sup>
   
   cc @nealrichardson in case he has any input.
   
   I will see about changing GCS to reject file paths that end with slashes. 
Should I leave S3 alone? Or should it also reject them?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to