Skip to content

Commit 347159e

Browse files
committed
add comment to clarify what is happening
1 parent c98a597 commit 347159e

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

R/arc-select.R

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ collect_layer <- function(
156156
page_size = NULL,
157157
...,
158158
error_call = rlang::caller_env()) {
159-
160159
# 1. Make base request
161160
# 2. Identify necessary query parameters
162161
# 3. Figure out offsets and update query parameters
@@ -260,12 +259,17 @@ collect_layer <- function(
260259

261260
#' Get query responses with handling for layers that don't support pagination
262261
#' @noRd
263-
get_query_resps <- function(req,
264-
x,
265-
n_feats,
266-
page_size = NULL,
267-
query_params = list(),
268-
error_call = rlang::caller_env()) {
262+
get_query_resps <- function(
263+
req,
264+
x,
265+
n_feats,
266+
page_size = NULL,
267+
query_params = list(),
268+
error_call = rlang::caller_env()) {
269+
# If pagination is not supported, we create one query and return the results
270+
# in a list with a warning. This way the maximum number of results is returned
271+
# but the user is also informed that they will not get tha maximum number of
272+
# records. Otherwise, we continue and utilize the pagination
269273
if (isFALSE(x[["advancedQueryCapabilities"]][["supportsPagination"]])) {
270274
if (n_feats > x[["maxRecordCount"]]) {
271275
cli::cli_warn(
@@ -470,8 +474,7 @@ count_results <- function(req, query, n_max = Inf, error_call = rlang::caller_en
470474
validate_results_count <- function(
471475
n_results = NULL,
472476
n_max = Inf,
473-
error_call = rlang::caller_env()
474-
) {
477+
error_call = rlang::caller_env()) {
475478
if (is.null(n_results)) {
476479
cli::cli_abort(
477480
c(

0 commit comments

Comments
 (0)