You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "paleolimbot (via GitHub)" <gi...@apache.org> on 2023/06/16 13:13:42 UTC

[GitHub] [arrow] paleolimbot commented on pull request #35055: GH-34436: [R] Bindings for JSON Dataset

paleolimbot commented on PR #35055:
URL: https://github.com/apache/arrow/pull/35055#issuecomment-1594658371

   I don't think that our previous lack of of test coverage should mean that we continue to add features that are not tested. I am also happy to defer to another review on this, though.
   
   How about:
   
   ``` r
   library(arrow, warn.conflicts = FALSE)
   #> Some features are not enabled in this build of Arrow. Run `arrow_info()` for more information.
   library(testthat, warn.conflicts = FALSE)
   
   test_that("JsonParseOptions are passed through to the dataset", {
     tf <- tempfile()
     on.exit(unlink(tf))
     write('{"key": "value"}', tf)
     
     expect_error(
       # (but instead use open_dataset())
       read_json_arrow(tf, schema = schema(key = int32())),
       "parse error"
     )
   })
   #> Test passed 😀
   ```
   
   (Ideally we'd be able to do something like `dataset$parse_options$schema` instead, which I think you've started to implement with the CSV options, but this seems slightly easier)


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org