diff --git a/models/br_inep_saeb/br_inep_saeb__brasil.sql b/models/br_inep_saeb/br_inep_saeb__brasil.sql index 1b8a6408..5558285e 100644 --- a/models/br_inep_saeb/br_inep_saeb__brasil.sql +++ b/models/br_inep_saeb/br_inep_saeb__brasil.sql @@ -5,7 +5,11 @@ select safe_cast(lower(rede) as string) rede, safe_cast(lower(localizacao) as string) localizacao, safe_cast(disciplina as string) disciplina, - safe_cast(serie as int64) serie, + safe_cast( + case + when serie = "12" then "3" when serie = "13" then "4" else serie + end as int64 + ) serie, safe_cast(media as float64) media, safe_cast(nivel_0 as float64) nivel_0, safe_cast(nivel_1 as float64) nivel_1, diff --git a/models/br_inep_saeb/br_inep_saeb__municipio.sql b/models/br_inep_saeb/br_inep_saeb__municipio.sql index 77aa7b36..ffbb83b8 100644 --- a/models/br_inep_saeb/br_inep_saeb__municipio.sql +++ b/models/br_inep_saeb/br_inep_saeb__municipio.sql @@ -3,18 +3,22 @@ alias="municipio", schema="br_inep_saeb", materialized="table", - labels={"tema": "educacao"}, + labels={"project_id": "basedosdados-dev", "tema": "educacao"}, ) }} select safe_cast(ano as int64) ano, - safe_cast(rede as string) rede, - safe_cast(localizacao as string) localizacao, + safe_cast(lower(rede) as string) rede, + safe_cast(lower(localizacao) as string) localizacao, safe_cast(sigla_uf as string) sigla_uf, safe_cast(id_municipio as string) id_municipio, safe_cast(disciplina as string) disciplina, - safe_cast(serie as int64) serie, + safe_cast( + case + when serie = "12" then "3" when serie = "13" then "4" else serie + end as int64 + ) serie, round(safe_cast(media as float64), 2) media, round(safe_cast(nivel_0 as float64), 2) nivel_0, round(safe_cast(nivel_1 as float64), 2) nivel_1, diff --git a/models/br_inep_saeb/br_inep_saeb__uf.sql b/models/br_inep_saeb/br_inep_saeb__uf.sql index 8716a735..b01b66bf 100644 --- a/models/br_inep_saeb/br_inep_saeb__uf.sql +++ b/models/br_inep_saeb/br_inep_saeb__uf.sql @@ -8,7 +8,11 @@ with safe_cast(localizacao as string) localizacao, safe_cast(sigla_uf as string) sigla_uf, safe_cast(disciplina as string) disciplina, - safe_cast(serie as int64) serie, + safe_cast( + case + when serie = "12" then "3" when serie = "13" then "4" else serie + end as int64 + ) serie, safe_cast(media as float64) media, safe_cast(nivel_0 as float64) nivel_0, safe_cast(nivel_1 as float64) nivel_1,