Skip to content

Commit

Permalink
Merge branch 'main' into deploy-elementary-report
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfg authored Apr 3, 2024
2 parents 3a9c5c3 + 77213d0 commit d5155b8
Show file tree
Hide file tree
Showing 9 changed files with 1,358 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ models:
br_inep_saeb:
+materialized: table
+schema: br_inep_saeb
br_inep_sinopse_estatistica_educacao_basica:
+materialized: table
+schema: br_inep_sinopse_estatistica_educacao_basica
br_inmet_bdmep:
+materialized: table
+schema: br_inmet_bdmep
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{
config(
alias="dicionario",
schema="br_inep_sinopse_estatistica_educacao_basica",
materialized="table",
)
}}


select
safe_cast(id_tabela as string) id_tabela,
safe_cast(nome_coluna as string) nome_coluna,
safe_cast(chave as string) chave,
safe_cast(cobertura_temporal as string) cobertura_temporal,
safe_cast(valor as string) valor
from
`basedosdados-staging.br_inep_sinopse_estatistica_educacao_basica_staging.dicionario`
as t
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{
config(
alias="etapa_ensino_serie",
schema="br_inep_sinopse_estatistica_educacao_basica",
materialized="table",
partition_by={
"field": "ano",
"data_type": "int64",
"range": {"start": 2007, "end": 2023, "interval": 1},
},
cluster_by="sigla_uf",
)
}}
select
safe_cast(ano as int64) ano,
safe_cast(sigla_uf as string) sigla_uf,
safe_cast(id_municipio as string) id_municipio,
safe_cast(rede as string) rede,
safe_cast(etapa_ensino as string) etapa_ensino,
safe_cast(serie as int64) serie,
safe_cast(quantidade_matricula as int64) quantidade_matricula,
from
`basedosdados-staging.br_inep_sinopse_estatistica_educacao_basica_staging.etapa_ensino_serie`
as t
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{
config(
alias="faixa_etaria",
schema="br_inep_sinopse_estatistica_educacao_basica",
materialized="table",
partition_by={
"field": "ano",
"data_type": "int64",
"range": {"start": 2007, "end": 2023, "interval": 1},
},
cluster_by="sigla_uf",
)
}}
select
safe_cast(ano as int64) ano,
safe_cast(sigla_uf as string) sigla_uf,
safe_cast(id_municipio as string) id_municipio,
safe_cast(etapa_ensino as string) etapa_ensino,
safe_cast(faixa_etaria as string) faixa_etaria,
safe_cast(quantidade_matricula as int64) quantidade_matricula,
from
`basedosdados-staging.br_inep_sinopse_estatistica_educacao_basica_staging.faixa_etaria`
as t
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{
config(
alias="localizacao",
schema="br_inep_sinopse_estatistica_educacao_basica",
materialized="table",
partition_by={
"field": "ano",
"data_type": "int64",
"range": {"start": 2007, "end": 2023, "interval": 1},
},
cluster_by="sigla_uf",
)
}}
select
safe_cast(ano as int64) ano,
safe_cast(sigla_uf as string) sigla_uf,
safe_cast(
case
when id_municipio = "3201705"
then "3201605"
when id_municipio = "4201704"
then "4201604"
when id_municipio = "4201753"
then "4201653"
when id_municipio = "5201703"
then "5201603"
end as string
) id_municipio,
safe_cast(rede as string) rede,
safe_cast(etapa_ensino as string) etapa_ensino,
safe_cast(localizacao as string) localizacao,
safe_cast(quantidade_matricula as int64) quantidade_matricula,
from
`basedosdados-staging.br_inep_sinopse_estatistica_educacao_basica_staging.localizacao`
as t
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{
config(
alias="sexo_raca_cor",
schema="br_inep_sinopse_estatistica_educacao_basica",
materialized="table",
partition_by={
"field": "ano",
"data_type": "int64",
"range": {"start": 2007, "end": 2023, "interval": 1},
},
cluster_by="sigla_uf",
)
}}
select
safe_cast(ano as int64) ano,
safe_cast(sigla_uf as string) sigla_uf,
safe_cast(id_municipio as string) id_municipio,
safe_cast(etapa_ensino as string) etapa_ensino,
safe_cast(sexo as string) sexo,
safe_cast(raca_cor as string) raca_cor,
safe_cast(quantidade_matricula as int64) quantidade_matricula,
from
`basedosdados-staging.br_inep_sinopse_estatistica_educacao_basica_staging.sexo_raca_cor`
as t
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{
config(
alias="tempo_ensino",
schema="br_inep_sinopse_estatistica_educacao_basica",
materialized="table",
partition_by={
"field": "ano",
"data_type": "int64",
"range": {"start": 2007, "end": 2023, "interval": 1},
},
cluster_by="sigla_uf",
)
}}
select
safe_cast(ano as int64) ano,
safe_cast(sigla_uf as string) sigla_uf,
safe_cast(id_municipio as string) id_municipio,
safe_cast(rede as string) rede,
safe_cast(tempo_ensino as string) tempo_ensino,
safe_cast(etapa_ensino as string) etapa_ensino,
safe_cast(quantidade_matricula as int64) quantidade_matricula,
from
`basedosdados-staging.br_inep_sinopse_estatistica_educacao_basica_staging.tempo_ensino`
as t
Loading

0 comments on commit d5155b8

Please sign in to comment.