Skip to content

Commit

Permalink
Merge pull request #672 from basedosdados/add-test-in-diretorios
Browse files Browse the repository at this point in the history
[fix] br_bd_diretorios
  • Loading branch information
tricktx authored Jul 10, 2024
2 parents 98c0c51 + 1815e78 commit 07c7f1f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ with
select
safe_cast(id_setor_censitario as string) id_setor_censitario,
safe_cast(id_municipio as string) id_municipio,
safe_cast(id_rm as string) id_regiao_metropolitana,
safe_cast(id_regiao_metropolitana as string) id_regiao_metropolitana,
safe_cast(id_distrito as string) id_distrito,
safe_cast(id_subdistrito as string) id_subdistrito,
safe_cast(nome_subdistrito as string) nome_subdistrito,
Expand All @@ -20,8 +20,7 @@ with
safe_cast(sigla_uf as string) sigla_uf,
safe_cast(situacao_setor as string) situacao_setor,
safe_cast(tipo_setor as string) tipo_setor
from
`basedosdados-staging.br_bd_diretorios_brasil_staging.setor_censitario` as t
from `basedosdados.br_bd_diretorios_brasil.setor_censitario_2010` as t
)

select
Expand All @@ -44,7 +43,5 @@ left join
`basedosdados.br_bd_diretorios_brasil.municipio` as b
on a.id_municipio = b.id_municipio
left join
(
select * from `basedosdados.br_bd_diretorios_brasil.distrito` where ano = 2010
) as c
(select * from `basedosdados.br_bd_diretorios_brasil.distrito_2010`) as c
on a.id_distrito = c.id_distrito
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
{{
config(
alias="uf",
schema="br_bd_diretorios_brasil",
materialized="table",
)
}}

select
safe_cast(id_uf as string) id_uf,
safe_cast(sigla as string) sigla,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
{{
config(
alias="pais",
schema="br_bd_diretorios_mundo",
materialized="table",
cluster_by="sigla_pais_iso3",
)
}}
{{ config(alias="pais", schema="br_bd_diretorios_mundo", materialized="table") }}

select
safe_cast(id_pais_m49 as string) id_pais_m49,
Expand Down

0 comments on commit 07c7f1f

Please sign in to comment.