Open writing-versioncontrol opened 9 months ago
roda o basedosdados::read_sql
sem o billing_id. somente a query. Além disso, verifica a inserção/remoção das aspas. Veja esse exemplo que talvez possa te ajudar: https://github.com/basedosdados/analises/blob/main/redes_sociais/br_ibge_censo_agropecuario_20220602.R
Descrição Tentando baixar dados, usando exemplo da documentação basedosdados::read_sql().
Da errado: Error in
signal_reason()
: ! ProjectId and DatasetId must be non-empty [badRequest]Reproduzir Passos para reproduzir o comportamento:
basedosdados::set_billing_id("br_census_sum_stats") query <- "SELECT pib.id_municipio, pop.ano, pib.PIB / pop.populacao * 1000 as pib_per_capita FROM
basedosdados.br_ibge_pib.municipio
as pib JOINbasedosdados.br_ibge_populacao.municipio
as pop ON pib.id_municipio = pop.id_municipio LIMIT 5 " data <- basedosdados::read_sql(query, billing_project_id = "br_census_sum_stats") Error insignal_reason()
: ! ProjectId and DatasetId must be non-empty [badRequest] Runrlang::last_trace()
to see where the error occurred.Backtrace: ▆
Comportamento esperado Baixar o data set.
Capturas de tela
Desktop (preencha as seguintes informações):
Matrix products: default
locale: [1] LC_COLLATE=Portuguese_Brazil.utf8 LC_CTYPE=Portuguese_Brazil.utf8 LC_MONETARY=Portuguese_Brazil.utf8 [4] LC_NUMERIC=C LC_TIME=Portuguese_Brazil.utf8
time zone: America/Sao_Paulo tzcode source: internal
attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] bit64_4.0.5 bit_4.0.5 lubridate_1.9.2 forcats_1.0.0 stringr_1.5.0 dplyr_1.1.2
[7] purrr_1.0.1 readr_2.1.4 tidyr_1.3.0 tibble_3.2.1 ggplot2_3.4.2 tidyverse_2.0.0
[13] DescTools_0.99.52
loaded via a namespace (and not attached): [1] gld_2.6.6 gtable_0.3.3 dotenv_1.0.3 gargle_1.5.0 lattice_0.21-8 tzdb_0.4.0
[7] vctrs_0.6.2 tools_4.3.0 generics_0.1.3 curl_5.0.1 proxy_0.4-27 fansi_1.0.4
[13] pkgconfig_2.0.3 Matrix_1.6-1.1 data.table_1.14.8 dbplyr_2.3.2 readxl_1.4.2 assertthat_0.2.1
[19] lifecycle_1.0.3 rootSolve_1.8.2.4 compiler_4.3.0 Exact_3.2 munsell_0.5.0 bigrquery_1.4.2
[25] httpuv_1.6.11 class_7.3-21 crayon_1.5.2 later_1.3.1 pillar_1.9.0 MASS_7.3-58.4
[31] openssl_2.0.6 boot_1.3-28.1 tidyselect_1.2.0 mvtnorm_1.2-4 stringi_1.7.12 rprojroot_2.0.3
[37] grid_4.3.0 here_1.0.1 colorspace_2.1-0 lmom_3.0 expm_0.999-9 cli_3.6.1
[43] magrittr_2.0.3 utf8_1.2.3 e1071_1.7-13 withr_2.5.0 promises_1.2.0.1 rappdirs_0.3.3
[49] scales_1.2.1 writexl_1.4.2 timechange_0.2.0 httr_1.4.6 basedosdados_0.2.2 typed_0.0.1
[55] cellranger_1.1.0 askpass_1.1 hms_1.1.3 rlang_1.1.1 Rcpp_1.0.10 glue_1.6.2
[61] DBI_1.1.3 rstudioapi_0.14 jsonlite_1.8.7 R6_2.5.1 fs_1.6.2