paleolimbot commented on code in PR #34524:
URL: https://github.com/apache/arrow/pull/34524#discussion_r1142216825


##########
r/tests/testthat/test-gcs.R:
##########
@@ -91,6 +91,26 @@ test_that("GcsFileSystem$create() input validation", {
   )
 })
 
+test_that("GcsFileSystem$create() can read json_credentials", {
+  # From string
+  fs <- GcsFileSystem$create(json_credentials = "fromstring")
+  expect_equal(fs$options$json_credentials, "fromstring")
+
+  # From disk
+  cred_path <- tempfile()
+  on.exit(unlink(cred_path))
+  con <- file(cred_path, open = "wb")
+  writeBin('{"key" : "valu\u00e9"}', con)
+  close(con)
+
+  # This calls readLines which complains about embedded nuls and missing a
+  # final newline (See ?readLines)
+  suppressWarnings({

Review Comment:
   Rather than suppress this warning, you could (1) use something other than 
`readLines()` or (2) include a final newline in your test data. I'm guessing 
these are files downloaded from the google cloud console 99% of the time, so 
including a final newline would probably be sufficient.
   
   (otherwise we might suppress warnings that are actual problems)



-- 
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