From bf9476fde58e8f77ae06f54ee87f48a0a621e9f8 Mon Sep 17 00:00:00 2001 From: Yannik Buhl Date: Fri, 27 Sep 2024 20:29:06 +0200 Subject: [PATCH 1/3] Update gen_table.R --- R/gen_table.R | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/R/gen_table.R b/R/gen_table.R index 67a14ef..6fb243b 100644 --- a/R/gen_table.R +++ b/R/gen_table.R @@ -75,8 +75,7 @@ gen_table_ <- function(name, stand = NULL, language = Sys.getenv("GENESIS_LANG"), job = FALSE, - all_character = TRUE, - overwrite_url = NULL) { + all_character = TRUE) { #----------------------------------------------------------------------------- # Parameter processing @@ -88,14 +87,6 @@ gen_table_ <- function(name, } - if (!is.null(overwrite_url) & - (!is.character(overwrite_url) | length(overwrite_url) != 1)) { - - stop("The parameter 'overwrite_url' has to be of type 'character' and of length 1.", - call. = FALSE) - - } - database <- match.arg(database) area <- match.arg(area) @@ -141,8 +132,7 @@ gen_table_ <- function(name, stand = stand, language = language, format = "ffcsv", - job = FALSE, - overwrite_url = overwrite_url) + job = FALSE) #----------------------------------------------------------------------------- @@ -166,8 +156,7 @@ gen_table_ <- function(name, stand = stand, language = language, format = "ffcsv", - job = job, - overwrite_url = overwrite_url) + job = job) #----------------------------------------------------------------------------- @@ -191,8 +180,7 @@ gen_table_ <- function(name, stand = stand, language = language, format = "ffcsv", - job = job, - overwrite_url = overwrite_url) + job = job) #----------------------------------------------------------------------------- From 97c7722066f5aa72e1a10e43a545f0beb4da125b Mon Sep 17 00:00:00 2001 From: Yannik Buhl Date: Fri, 27 Sep 2024 20:30:00 +0200 Subject: [PATCH 2/3] Update gen_api.R --- R/gen_api.R | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/R/gen_api.R b/R/gen_api.R index e79791b..9bbfb42 100644 --- a/R/gen_api.R +++ b/R/gen_api.R @@ -20,9 +20,7 @@ gen_genesis_api <- function(endpoint, overwrite_url, ...) { - url <- ifelse(is.null(overwrite_url), - "https://www-genesis.destatis.de/genesisWS/rest/2020", - overwrite_url) + url <- "https://www-genesis.destatis.de/genesisWS/rest/2020" user_agent <- "https://github.com/CorrelAid/restatis" @@ -75,9 +73,7 @@ gen_regio_api <- function(endpoint, overwrite_url, ...) { - url <- ifelse(is.null(overwrite), - "https://www.regionalstatistik.de/genesisws/rest/2020/", - overwrite_url) + url <- "https://www.regionalstatistik.de/genesisws/rest/2020/" httr2::request(url) %>% httr2::req_user_agent("https://github.com/CorrelAid/restatis") %>% @@ -112,9 +108,7 @@ gen_zensus_api <- function(endpoint, overwrite_url, ...) { - url <- ifelse(is.null(overwrite_url), - "https://ergebnisse.zensus2022.de/api/rest/2020", - overwrite_url) + url <- "https://ergebnisse.zensus2022.de/api/rest/2020" user_agent <- "https://github.com/CorrelAid/restatis" From ccc55c5841bf7a0c6b6ba8a4eb7c0d14ea964a65 Mon Sep 17 00:00:00 2001 From: buhly Date: Fri, 27 Sep 2024 20:46:42 +0200 Subject: [PATCH 3/3] revert stupid stuff --- R/gen_api.R | 6 ------ 1 file changed, 6 deletions(-) diff --git a/R/gen_api.R b/R/gen_api.R index 9bbfb42..16ccc8a 100644 --- a/R/gen_api.R +++ b/R/gen_api.R @@ -3,7 +3,6 @@ #' @description Low-level function to interact with the GENESIS API #' #' @param endpoint Character string. The endpoint of the API that is to be queried. -#' @param overwrite_url Character string. In certain cases it is required to set a custom URL for the respective API. By specifying the URL in this parameter, the API calls will be directed to this custom URL. But be aware, the URL has to lead to the same database (in this case: GENESIS), else there will be errors. Hence, use with caution. #' @param ... Further parameters passed on to the final API call. #' #' @importFrom httr2 `%>%` @@ -17,7 +16,6 @@ #' } #' gen_genesis_api <- function(endpoint, - overwrite_url, ...) { url <- "https://www-genesis.destatis.de/genesisWS/rest/2020" @@ -56,7 +54,6 @@ gen_genesis_api <- function(endpoint, #' @description Low-level function to interact with the regionalstatistik.de API #' #' @param endpoint Character string. The endpoint of the API that is to be queried. -#' @param overwrite_url Character string. In certain cases it is required to set a custom URL for the respective API. By specifying the URL in this parameter, the API calls will be directed to this custom URL. But be aware, the URL has to lead to the same database (in this case: www.regionalstatistik.de), else there will be errors. Hence, use with caution. #' @param ... Further parameters passed on to the final API call. #' #' @importFrom httr2 `%>%` @@ -70,7 +67,6 @@ gen_genesis_api <- function(endpoint, #' } #' gen_regio_api <- function(endpoint, - overwrite_url, ...) { url <- "https://www.regionalstatistik.de/genesisws/rest/2020/" @@ -91,7 +87,6 @@ gen_regio_api <- function(endpoint, #' @description Low-level function to interact with the Zensus 2022 database #' #' @param endpoint Character string. The endpoint of the API that is to be queried. -#' @param overwrite_url Character string. In certain cases it is required to set a custom URL for the respective API. By specifying the URL in this parameter, the API calls will be directed to this custom URL. But be aware, the URL has to lead to the same database (in this case: Zensus 2022), else there will be errors. Hence, use with caution. #' @param ... Further parameters passed on to the final API call. #' #' @importFrom httr2 `%>%` @@ -105,7 +100,6 @@ gen_regio_api <- function(endpoint, #' } #' gen_zensus_api <- function(endpoint, - overwrite_url, ...) { url <- "https://ergebnisse.zensus2022.de/api/rest/2020"