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

need to clear API calls when building available_datasets()? #133

Open
jeffeaton opened this issue Jun 9, 2022 · 0 comments
Open

need to clear API calls when building available_datasets()? #133

jeffeaton opened this issue Jun 9, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@jeffeaton
Copy link
Collaborator

For @OJWatson -- I have just been getting this error:

Browse[4]> tmp <- self$available_datasets(TRUE)
Logging into DHS website...
Creating Download url list from DHS website...
Some of your available datasets are not found in the DHS API.This is likely due to the DHS API being out of date and as such some of the meta information about your available datasets may not be available.

It arises when the API was updated with the new Mauritania 2020-21 DHS was released. Trevor updated the DHS API to reflect that last night. But I continued to get this error because available_datasets(clear_cache_first = TRUE) was accessing a cached version of the "datasets" API call instead of re-polling the API endpoint for an update, even when clear_cache_first = TRUE.

I think that in this bit of code, if clear_cache_first = TRUE we either need to clear the cached versions of the "datasets" and "surveys" endpoints first , or add an argument to self$dhs_api_request() to force a call to the API rather than accessing cached call.

rdhs/R/client.R

Lines 322 to 329 in 39d0961

# Get downloadable datasets
resp <- available_datasets(
config = private$config,
datasets_api_results = self$dhs_api_request("datasets",
num_results = "ALL"),
surveys_api_results = self$dhs_api_request("surveys",
num_results = "ALL")
)

@OJWatson OJWatson self-assigned this Jun 14, 2022
@OJWatson OJWatson added the enhancement New feature or request label Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants