UrbanInstitute / education-data-package-r

https://urbaninstitute.github.io/education-data-package-r/
Other
86 stars 11 forks source link

add `verbose` argument to `get_education_data` to optionally quash warnings #109

Closed almartin82 closed 1 year ago

almartin82 commented 1 year ago

🤩 love the package and love the work! have been singing the praises of educationdata to my network.

by way of motivation, I've developed an interface into nj education data, which has zigged and zagged between file formats and data structures a number of times in the past 25 years. educationdata has been amazing to cross-check enrollment figures (mainly reported in the fall by NJ) against the spring (as reported in the CCD, as far as I can gather).

there are times when a valid call will throw a warning in educationdata, namely when 0 students are returned for a particular grade/year combination. as I'm sure you know well, CRAN checks do not love warnings. I found myself in a bit of an antipattern where I was wrapping calls to get_education_data in suppressMessages and suppressWarnings, so I figured it might make more sense to contribute an optional argument to make get_education_data calls less chatty.

verbose is introduced as a new function argument, with default behavior TRUE, which changes nothing about get_education_data calls in the wild - this would not be a breaking change for anyone using the package. if set to FALSE, it will quiet the status messages about which data is being fetched, and will also silence the warning that a query returned no results.

Feel free to close this PR if it doesn't align with your vision for the package - it's easy for me to use my fork. But thought I would submit my changes back upstream.

erika-tyagi commented 1 year ago

Hi @almartin82 - thanks so much for the kind words, and I'm so glad to hear you've gotten value from the portal and package! I think this is a great contribution, and I'm happy to merge. I'll open a separate PR to update the docs and bump the version. Thank you again for contributing!