Skip to content

Commit

Permalink
Merge pull request #221 from elipousson/warn-mismatch-nfeats
Browse files Browse the repository at this point in the history
Fix #220 by adding informative warning
  • Loading branch information
JosiahParry authored Sep 25, 2024
2 parents e942edb + c0a776d commit 8dc9093
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Bug fixes

- `page_size` resulted in error due to introduction of type-check. Fixed and added test to avoid in the future. [#205](https://github.com/R-ArcGIS/arcgislayers/issues/205)
- Add warning if `arc_select()` results include fewer features than expected from request [#220](https://github.com/R-ArcGIS/arcgislayers/issues/220)

## New features

Expand Down
11 changes: 11 additions & 0 deletions R/arc-select.R
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,17 @@ collect_layer <- function(
sf::st_crs(res) <- sf::st_crs(x)
}

if (nrow(res) < n_feats) {
# See https://github.com/R-ArcGIS/arcgislayers/issues/110
cli::cli_warn(
c(
"Results include fewer than the expected {n_feats} features.",
"*" = "Try setting {.arg page_size} to a smaller value to make
sure results include all available features."
)
)
}

res
}

Expand Down

0 comments on commit 8dc9093

Please sign in to comment.