Skip to content
Snippets Groups Projects
Commit f21c53bd authored by Juliette Engelaere-Lefebvre's avatar Juliette Engelaere-Lefebvre
Browse files

Correction d'un bug dans `poster_data()`, la fonction plantait si les...

Correction d'un bug dans `poster_data()`, la fonction plantait si les modalités d'un facteur contenaient des caractères spéciaux. Conversion des levels en caractères ACSII avant post sur zz_r_df_def
parent a2f0f0fa
No related branches found
No related tags found
No related merge requests found
Pipeline #58811 failed
Package: datalibaba
Title: Interface De Connexion a Une Base Posgres Postgis
Version: 0.0.0.9002
Version: 0.0.0.9003
Authors@R:
c(person(given = "Maël",
family = "Theulière",
......@@ -32,7 +32,8 @@ Imports:
magrittr,
tibble,
units,
tidyr
tidyr,
gtools
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
......
......@@ -52,6 +52,7 @@ importFrom(dplyr,filter)
importFrom(dplyr,mutate)
importFrom(dplyr,pull)
importFrom(dplyr,relocate)
importFrom(dplyr,rename_with)
importFrom(dplyr,select)
importFrom(dplyr,summarise)
importFrom(dplyr,transmute)
......@@ -60,6 +61,7 @@ importFrom(fs,path)
importFrom(fs,path_expand)
importFrom(fs,path_home_r)
importFrom(glue,glue)
importFrom(gtools,ASCIIfy)
importFrom(magrittr,"%>%")
importFrom(odbc,odbc)
importFrom(purrr,map)
......
# datalibaba 0.0.0.9003
- Correction d'un bug dans `poster_data()`, la fonction plantait si les modalités d'un facteur contenaient des caractères spéciaux.
# datalibaba 0.0.0.9002
- Correction d'un bug dans la fonction `importer_data()` : nommage du champ geo tel qu'il avait été chargé
......
......@@ -59,7 +59,7 @@ get_data_dbi <- function(con = NULL,
#' @return la table de donnees, au format dataframe ou sf dataframe si une colonne de type 'USER-DEFINED' est presente dans la table sgbd
#' @importFrom attempt stop_if stop_if_not
#' @importFrom DBI dbExistsTable dbReadTable dbDisconnect
#' @importFrom dplyr filter arrange select all_of relocate
#' @importFrom dplyr filter arrange select all_of relocate rename_with
#' @importFrom rlang .data
#' @importFrom rpostgis dbTableInfo
#' @importFrom sf st_read st_drop_geometry st_geometry
......
......@@ -42,6 +42,7 @@ post_data <- function(con,
#' @param overwrite TRUE si on veut ecraser le fichier deja present.
#' @importFrom attempt stop_if stop_if_not
#' @importFrom DBI dbWriteTable Id dbSendQuery
#' @importFrom gtools ASCIIfy
#' @importFrom glue glue
#'
#' @return NULL, la fonction lance le chargement du dataset present dans l'environnement R et son ecriture sur le serveur
......@@ -199,7 +200,7 @@ poster_data <- function(data = NULL,
paste(as.character(attr2), collapse = ","), "},{",
paste(noms_r, collapse = ","), "}}")
defs2 <- data.frame(table_nm = table, df_def = defs)
defs2 <- data.frame(table_nm = table, df_def = gtools::ASCIIfy(defs))
suppressWarnings(suppressMessages({
rpostgis::pgInsert(con, c(schema, "zz_r_df_def"), defs2, upsert.using = "table_nm",
row.names = FALSE)
......
......@@ -25,6 +25,7 @@ usethis::use_package("rlang")
usethis::use_package("units")
usethis::use_package("tibble")
usethis::use_package("tidyr")
usethis::use_package("gtools")
attachment::att_amend_desc()
devtools::document()
pkgdown::build_site()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment