@@ -86,17 +86,6 @@ arc_select <- function(
86
86
check_string(where , allow_null = TRUE , allow_empty = FALSE )
87
87
check_character(fields , allow_null = TRUE )
88
88
89
-
90
- check_number_whole(as.integer(page_size ), min = 1 , allow_null = TRUE )
91
- check_number_whole(
92
- as.integer(page_size ),
93
- # bug in the standalone checks
94
- # needs to be a double and cannot be used with
95
- # max at the same time which is why it is brought into two calls
96
- max = as.double(x [[" maxRecordCount" ]]),
97
- allow_null = TRUE
98
- )
99
-
100
89
# extract the query object
101
90
query <- attr(x , " query" )
102
91
@@ -216,7 +205,7 @@ collect_layer <- function(
216
205
# get existing parameters
217
206
218
207
# determine_format() chooses between pbf and json
219
- out_f <- determine_format(x )
208
+ out_f <- determine_format(x , call = error_call )
220
209
221
210
query_params <- validate_params(
222
211
query ,
@@ -600,35 +589,24 @@ validate_page_size <- function(
600
589
page_size = NULL ,
601
590
max_records = NULL ,
602
591
error_call = rlang :: caller_env()) {
603
- # if page_size is null, use max records (default)
604
- page_size <- page_size %|| % max_records
605
-
606
- # coerce to integer
607
- page_size <- as.integer(page_size )
608
-
609
- if (! is.numeric(page_size ) && ! length(page_size ) == 0 ) {
610
- cli :: cli_abort(
611
- " {.arg page_size} must be a numeric scalar,
612
- not {.obj_type_friendly {page_size}}" ,
613
- call = error_call
614
- )
592
+ if (is.numeric(page_size )) {
593
+ # coerce to integer if page_size is numeric
594
+ page_size <- as.integer(page_size )
615
595
}
616
596
617
- page_size_len <- length(page_size )
618
-
619
- if (! rlang :: has_length(page_size , 1 )) {
620
- cli :: cli_abort(
621
- " {.arg page_size} must be length 1, not {page_size_len}" ,
622
- call = error_call
623
- )
624
- }
597
+ check_number_whole(page_size , min = 1 , allow_null = TRUE , call = error_call )
598
+ check_number_whole(
599
+ page_size ,
600
+ # bug in the standalone checks
601
+ # needs to be a double and cannot be used with
602
+ # max at the same time which is why it is brought into two calls
603
+ max = as.double(max_records ),
604
+ allow_null = TRUE ,
605
+ call = error_call
606
+ )
625
607
626
- if (page_size < 1 ) {
627
- cli :: cli_abort(
628
- " {.arg page_size} must be a positive integer." ,
629
- call = error_call
630
- )
631
- }
608
+ # if page_size is null, use max records (default)
609
+ page_size <- page_size %|| % max_records
632
610
633
611
if (is.numeric(max_records ) && (page_size > max_records )) {
634
612
cli :: cli_abort(
@@ -646,7 +624,13 @@ validate_page_size <- function(
646
624
647
625
supports_pbf <- function (x , arg = rlang :: caller_arg(x ), call = rlang :: caller_call()) {
648
626
# verify that x is an layer
649
- obj_check_layer(x , arg , call )
627
+ # FIXME: This check makes arc_select error on ImageServer inputs
628
+ check_inherits_any(
629
+ x ,
630
+ class = c(" FeatureLayer" , " Table" , " ImageServer" ),
631
+ arg = arg ,
632
+ call = call
633
+ )
650
634
651
635
# extract supported query formats
652
636
query_formats_raw <- x [[" supportedQueryFormats" ]]
0 commit comments