Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add input check functions using {cli} #150

Merged
merged 10 commits into from
Feb 20, 2024
Merged

Conversation

elipousson
Copy link
Contributor

@elipousson elipousson commented Feb 18, 2024

Adds helper functions for input checks for arc_open(), add_features(), update_features(), and add_item() including:

  • check_dataframe
  • check_url (w/ is_url)
  • check_string
  • check_crs_match
  • check_add_item_args

Also adds inform_nin_feature() to reduce duplicative code between add_features() and update_features().

Also tries to make error and warning messages more consistent internally and consistent with the tidyverse style guide for error messages.

Checklist

  • update NEWS.md
  • documentation updated with devtools::document()
  • devtools::check() passes locally

Changes

This adds the general helper functions listed above to utils.R and other functions as appropriate. I did not include updates to NEWS.md or any changes to documentation in this PR.

Follow up tasks

More consistent input checks should be implemented overall and URL checking could be improved to ensure input URL is consistent with the type of URL that could be a ArcGIS Server or ArcGIS Online URL.

Adds helper functions for input checks for arc_open, add_features, update_features, and add_item:

- check_dataframe
- check_url (w/ is_url)
- check_string
- check_crs_match
- check_add_item_args

Also adds inform_nin_feature to reduce duplicate between add_features and update_features
Also remove non-ASCII characters from add_item
Copy link
Collaborator

@JosiahParry JosiahParry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using this as an opportunity to fix some issues with the readme.

Copy link
Collaborator

@JosiahParry JosiahParry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweeeeett! Thank you! I've simplified some code and made some adjustments where i saw fit. Thank you Veryyy much!

@JosiahParry JosiahParry merged commit 59601ea into R-ArcGIS:main Feb 20, 2024
7 checks passed
@elipousson
Copy link
Contributor Author

Great! The pattern argument in check_url could also help functions error on invalid URLs. I think the URL patterns for ArcGIS REST servers and AGOL services are consistent enough to support those kind of checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants