Skip to content

Conversation

@sampoves
Copy link

Failsafe for error 429 Too Many Requests

Failsafe for error 429 Too Many Requests
@pitkant
Copy link
Member

pitkant commented Dec 4, 2025

@sampoves thank you for the contribution! I tested it with your example code from #281 and everything worked like a charm. The package checks also passed.

Just as a minor note for possible future improvement (not something you need to fix, this works works after all) maybe the message "Request failed [429]. Retrying in 60 seconds..." might look menacing to a new user and prompt them to cancel the query?

> res <- pxweb::pxweb_get_data(pxweb_url, pxq)
  Downloading large query (in 36 batches):
  |===========================================================================                             |  72%
Request failed [429]. Retrying in 60 seconds...
  |========================================================================================================| 100%

But as I said it's good enough as it is.

@MansMeg I can make another PR with some package housekeeping like

  • bumping the version number
  • adding Sampo as a package contributor
  • fixing the double header in citation("pxweb")

and maybe the new version could be submitted to CRAN? I don't know when CRAN Christmas break starts but maybe there's still time before that.

@pitkant pitkant mentioned this pull request Dec 4, 2025
@sampoves
Copy link
Author

sampoves commented Dec 4, 2025

@pitkant Thank you for accepting the contribution 💫 Also, thank you for your continued work on this important package.

@sampoves sampoves closed this Dec 4, 2025
@sampoves sampoves reopened this Dec 4, 2025
@sampoves
Copy link
Author

sampoves commented Dec 4, 2025

Sorry for the mess-around, thought it may not be a good idea to close the pull request myself.

@pitkant
Copy link
Member

pitkant commented Dec 4, 2025

Yeah I think it's a good idea that changes to pxweb_get are merged from this PR so code contributions are attributed correctly.

@MansMeg
Copy link
Contributor

MansMeg commented Jan 1, 2026

Thanks! Changing to RETRY might be a good idea. However, I think we need to enable the user to govern this a little more, ie using ellippsis and using try = 1 as default in pxweb_get.

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.

3 participants