Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] br_ibge_censo_2022 #814

Merged
merged 2 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{
config(
alias="alfabetizacao_grupo_idade_sexo_raca",
schema="br_ibge_censo_2022",
)
}}
select
safe_cast(municipio_codigo_ as string) id_municipio,
safe_cast(cor_ou_raca as string) cor_raca,
safe_cast(sexo as string) sexo,
safe_cast(idade as string) grupo_idade,
safe_cast(alfabetizacao as string) alfabetizacao,
safe_cast(valor as int64) populacao,
from
`basedosdados-staging.br_ibge_censo_2022_staging.alfabetizacao_grupo_idade_sexo_raca`
as t

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{
config(
alias="morador_cor_raca_destino_lixo_municipio", schema="br_ibge_censo_2022"
alias="caracteristica_domicilio_grupo_idade_raca_destino_lixo",
schema="br_ibge_censo_2022",
)
}}
select
Expand All @@ -11,7 +12,7 @@ select
safe_cast(cor_ou_raca as string) cor_raca,
safe_cast(
moradores_em_domicilios_particulares_permanentes_ocupados_pessoas_ as int64
) moradores,
) populacao,
from
`basedosdados-staging.br_ibge_censo_2022_staging.morador_cor_raca_destino_lixo_municipio`
`basedosdados-staging.br_ibge_censo_2022_staging.caracteristica_domicilio_grupo_idade_raca_destino_lixo`
as t
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{
config(
alias="morador_cor_raca_esgotamento_sanitario_municipio",
alias="caracteristica_domicilio_grupo_idade_raca_esgotamento_sanitario",
schema="br_ibge_censo_2022",
)
}}
Expand All @@ -12,7 +12,7 @@ select
safe_cast(cor_ou_raca as string) cor_raca,
safe_cast(
moradores_em_domicilios_particulares_permanentes_ocupados_pessoas_ as int64
) moradores,
) populacao,
from
`basedosdados-staging.br_ibge_censo_2022_staging.morador_cor_raca_esgotamento_sanitario_municipio`
`basedosdados-staging.br_ibge_censo_2022_staging.caracteristica_domicilio_grupo_idade_raca_esgotamento_sanitario`
as t
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{
config(
alias="morador_cor_raca_ligacao_abastecimento_agua_municipio",
alias="caracteristica_domicilio_grupo_idade_raca_ligacao_abastecimento_agua",
schema="br_ibge_censo_2022",
)
}}
Expand All @@ -15,7 +15,7 @@ select
safe_cast(cor_ou_raca as string) cor_raca,
safe_cast(
moradores_em_domicilios_particulares_permanentes_ocupados_pessoas_ as int64
) moradores,
) populacao,
from
`basedosdados-staging.br_ibge_censo_2022_staging.morador_cor_raca_ligacao_abastecimento_agua_municipio`
`basedosdados-staging.br_ibge_censo_2022_staging.caracteristica_domicilio_grupo_idade_raca_ligacao_abastecimento_agua`
as t
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{{
config(
alias="morador_cor_raca_tipo_domicilio_municipio",
alias="caracteristica_domicilio_grupo_idade_raca_tipo_domicilio",
schema="br_ibge_censo_2022",
tag=["refazer"],
)
}}
select
Expand All @@ -12,7 +13,7 @@ select
safe_cast(cor_ou_raca as string) cor_raca,
safe_cast(
moradores_em_domicilios_particulares_permanentes_ocupados_pessoas_ as int64
) moradores,
) populacao,
from
`basedosdados-staging.br_ibge_censo_2022_staging.morador_cor_raca_tipo_domicilio_municipio`
`basedosdados-staging.br_ibge_censo_2022_staging.caracteristica_domicilio_grupo_idade_raca_tipo_domicilio`
as t

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{{
config(
alias="domicilio_recenseado_especie_municipio", schema="br_ibge_censo_2022"
)
}}
{{ config(alias="domicilio_recenseado", schema="br_ibge_censo_2022") }}
with
ibge as (
select
Expand All @@ -15,12 +11,10 @@ with
) sigla_uf,
safe_cast(especie as string) especie,
safe_cast(domicilios_recenseados_domicilios_ as int64) domicilios,
from
`basedosdados-staging.br_ibge_censo_2022_staging.domicilio_recenseado_especie_municipio`
as t
from `basedosdados-staging.br_ibge_censo_2022_staging.domicilio_recenseado` as t
)
select t2.cod as id_municipio, ibge.* except (municipio, nome_municipio, sigla_uf)
from ibge
left join
`basedosdados-dev.br_ibge_censo_2022_staging.auxiliary_table` t2
`basedosdados-staging.br_ibge_censo_2022_staging.auxiliary_table` t2
on ibge.municipio = t2.municipio

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{{
config(
alias="indice_envelhecimento_cor_raca_municipio", schema="br_ibge_censo_2022"
)
}}
{{ config(alias="indice_envelhecimento_raca", schema="br_ibge_censo_2022") }}
select
safe_cast(ano as int64) ano,
safe_cast(cod_ as string) id_municipio,
Expand All @@ -14,5 +10,4 @@ select
) indice_envelhecimento,
safe_cast(idade_mediana_anos_ as int64) idade_mediana,
safe_cast(replace(razao_de_sexo_razao_, ",", ".") as float64) razao_sexo,
from
`basedosdados-staging.br_ibge_censo_2022_staging.indice_envelhecimento_cor_raca_municipio` t
from `basedosdados-staging.br_ibge_censo_2022_staging.indice_envelhecimento_raca` t

This file was deleted.

This file was deleted.

Loading
Loading