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

Error using get_meteo_from "meteocat" #9

Closed
vflo opened this issue Sep 30, 2021 · 2 comments
Closed

Error using get_meteo_from "meteocat" #9

vflo opened this issue Sep 30, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@vflo
Copy link

vflo commented Sep 30, 2021

I have created a function to get subdaily meteo data for several days.

seq(as.Date('2021-06-01'), as.Date('2021-09-29'), 1) %>% 
  purrr::map(function(x){
    mg_options <- meteocat_options(resolution = 'hourly',  start_date = x,
                               api_key = "XXXXXXXXXXXXXX")
    meteodata <- get_meteo_from('meteocat', mg_options)
    save(meteodata, file = paste0("data/meteo/",x,'.RData'))
    return(meteodata)
    })

After running it, I got the next error message:
Error in UseMethod("rename") :
no applicable method for 'rename' applied to an object of class "NULL"

I have debugged the function. It seems I have exceeded the number of queries allowed by the api. Perhaps it would be useful to present the content message that is within the api_statuses variable:
[[1]]
[[1]]$status
[1] "OK"

[[1]]$code
[1] 429

[[1]]$message
[1] "Data received"

[[1]]$content
[[1]]$content$message
[1] "Limit Exceeded"

@MalditoBarbudo MalditoBarbudo self-assigned this Oct 6, 2021
@MalditoBarbudo MalditoBarbudo added the bug Something isn't working label Oct 6, 2021
@MalditoBarbudo
Copy link
Member

MalditoBarbudo commented Oct 6, 2021

Defintely a bug. In theory, 429 codes must be cought and an error should be rised (or, if is a temporal timeout limit, wait 60 seconds and retry again).
Let me check it

@MalditoBarbudo
Copy link
Member

It seems the fix broke something else, a return call was missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants