Crunch-io / rcrunch

R package for interacting with the Crunch API
https://crunch.io/r/crunch/
GNU Lesser General Public License v3.0
9 stars 15 forks source link

`getDatasetVariables()` produces warnings when `warnPartialMatchArgs = TRUE` #624

Closed rossellhayes closed 1 year ago

rossellhayes commented 1 year ago

getDatasetVariables(), getDatasetHiddenVariables() and getDatasetPrivateVariables() produce warnings when the option warnPartialMatchArgs is set to TRUE. Setting this option is often recommended to help developers avoid partial argument matching, which is discouraged.[^1] Because getDatasetVariables() is called internally by a number of functions, this warning is very common when working with crunch.

This reprex demonstrates the problem with code from the getting started vignette:

options(warnPartialMatchArgs = TRUE)

library(crunch)
set_crunch_opts("crunch.api" = "https://app.crunch.io/api/")
library(httptest)
start_vignette("crunch")
ds <- newDataset(SO_survey, name="Stack Overflow Developer Survey 2017")
dim(ds)
#> Warning in httpcache::buildCacheKey(varcat_url, query_params, extra =
#> "VariableCatalog"): partial argument match of 'extra' to 'extras'
#> Warning in httpcache::buildCacheKey(varcat_url, extra =
#> "HiddenVariableCatalog"): partial argument match of 'extra' to 'extras'
#> Warning in httpcache::buildCacheKey(varcat_url, extra =
#> "PrivateVariableCatalog"): partial argument match of 'extra' to 'extras'
#> [1] 1634   23

Created on 2023-07-19 with reprex v2.0.2

[^1]: e.g. in Advanced R