Closed
Conversation
There was a problem hiding this comment.
Pull request overview
This PR applies automated formatting across the {azkit} R package (R source + testthat suite) by running air format ., resulting primarily in whitespace/indentation and minor layout changes.
Changes:
- Re-indents and reflows R source files under
R/. - Re-indents and reflows testthat files under
tests/testthat/. - Removes/adjusts some blank lines as part of formatter output.
Reviewed changes
Copilot reviewed 8 out of 11 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
R/get_auth_token.R |
Formatting-only changes; includes a user-facing message string layout. |
R/get_container.R |
Formatting-only changes. |
R/helpers.R |
Formatting-only changes in helper utilities. |
R/list_files.R |
Formatting-only changes for blob listing helper. |
R/read_azure_files.R |
Formatting-only changes for Azure file readers + blob existence helper. |
R/read_azure_table.R |
Formatting-only changes for Azure table reader. |
tests/testthat/test-azkit_helpers.R |
Formatting-only changes in helper tests. |
tests/testthat/test-get_auth_token.R |
Formatting-only changes in auth token tests. |
tests/testthat/test-get_container.R |
Formatting-only changes in container tests. |
tests/testthat/test-list_files.R |
Formatting-only changes in list_files tests. |
tests/testthat/test-read_azure_files.R |
Formatting-only changes in read_azure_* tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
tests/testthat/test-get_container.R
Outdated
Comment on lines
+3
to
+4
| withr::with_envvar(c(AZ_CONTAINER = ""), get_container()) |> | ||
| expect_error("`AZ_CONTAINER` is not set", class = "rlang_error") |
tests/testthat/test-get_container.R
Outdated
Comment on lines
+6
to
+8
| c(AZ_CONTAINER = "results", AZ_STORAGE_EP = "") |> | ||
| withr::with_envvar(get_container()) |> | ||
| expect_error("`AZ_STORAGE_EP` is not set", class = "rlang_error") |
tests/testthat/test-get_auth_token.R
Outdated
Comment on lines
+8
to
+9
| generate_resource(version = 3) |> | ||
| expect_error() |
R/helpers.R
Outdated
Comment on lines
+123
to
+129
| check_nzchar <- function(x, message, pf = parent.frame()) { | ||
| if (is.null(x)) { | ||
| NULL | ||
| } | ||
| cnz <- "check_nzchar" # nolint | ||
| check_scalar_type(x, "string", "{.fn {cnz}}: {.var x} is not a string") | ||
| if (nzchar(x)) { | ||
| x | ||
| } else { | ||
| message <- paste0("{.fn {cnz}}: ", message) | ||
| cli::cli_abort(message, call = rlang::caller_call(), .envir = pf) | ||
| } | ||
| if (is.null(x)) { | ||
| NULL | ||
| } | ||
| cnz <- "check_nzchar" # nolint | ||
| check_scalar_type(x, "string", "{.fn {cnz}}: {.var x} is not a string") | ||
| if (nzchar(x)) { |
R/list_files.R
Outdated
Comment on lines
+31
to
+35
| list_files <- function(container, path = "", ext = "", recursive = TRUE) { | ||
| stopifnot(rlang::is_character(c(path, ext), 2)) | ||
| stopifnot(rlang::is_bool(recursive)) | ||
| pnf_msg <- ct_error_msg("Path {.val {path}} not found") | ||
| check_that(path, \(x) AzureStor::blob_dir_exists(container, x), pnf_msg) | ||
| stopifnot(rlang::is_character(c(path, ext), 2)) | ||
| stopifnot(rlang::is_bool(recursive)) | ||
| pnf_msg <- ct_error_msg("Path {.val {path}} not found") | ||
| check_that(path, \(x) AzureStor::blob_dir_exists(container, x), pnf_msg) |
R/get_auth_token.R
Outdated
Comment on lines
129
to
130
| "Alternatively, running {.fn AzureRMR::get_azure_login} or | ||
| {.fn AzureRMR::list_azure_tokens} may shed some light on the problem." |
R/get_auth_token.R
Outdated
Comment on lines
+64
to
+70
| resource = generate_resource(), | ||
| tenant = "common", | ||
| client_id = NULL, | ||
| auth_method = "authorization_code", | ||
| aad_version = 1, | ||
| force_refresh = FALSE, | ||
| ... |
R/get_container.R
Outdated
Comment on lines
+19
to
+22
| container_name = NULL, | ||
| token = NULL, | ||
| endpoint_url = NULL, | ||
| ... |
R/read_azure_files.R
Outdated
Comment on lines
+29
to
+33
| read_azure_parquet <- function(container, file, path = "/", info = NULL, ...) { | ||
| check_blob_exists(container, file, "parquet", info, path) |> | ||
| # using `dest = NULL` means pass the data through as a raw vector | ||
| AzureStor::download_blob(container, src = _, dest = NULL) |> | ||
| arrow::read_parquet(...) | ||
| check_blob_exists(container, file, "parquet", info, path) |> | ||
| # using `dest = NULL` means pass the data through as a raw vector | ||
| AzureStor::download_blob(container, src = _, dest = NULL) |> | ||
| arrow::read_parquet(...) |
R/read_azure_table.R
Outdated
Comment on lines
+13
to
+17
| read_azure_table <- function( | ||
| table_name = NULL, | ||
| table_endpoint = NULL, | ||
| token = NULL, | ||
| ... | ||
| table_name = NULL, | ||
| table_endpoint = NULL, | ||
| token = NULL, | ||
| ... |
Member
Author
|
I'm going to recreate this after #90 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
reformatted code base with
air format .