-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into update-br-inep-sinopse-educacao-basica
- Loading branch information
Showing
13 changed files
with
1,096 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
id: cc3f54e0-fd01-4495-bd12-aa41f3b24444 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 24 additions & 11 deletions
35
models/br_camara_dados_abertos/br_camara_dados_abertos__orgao_deputado.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,25 @@ | ||
{{ config(alias="orgao_deputado", schema="br_camara_dados_abertos") }} | ||
select distinct | ||
regexp_extract(uriorgao, r'/orgaos/(\d+)') as id_orgao, | ||
safe_cast(nomeorgao as string) nome, | ||
safe_cast(siglaorgao as string) sigla, | ||
safe_cast(nomedeputado as string) nome_deputado, | ||
safe_cast(cargo as string) cargo, | ||
safe_cast(siglauf as string) sigla_uf, | ||
safe_cast(datainicio as date) data_inicio, | ||
safe_cast(datafim as date) data_final, | ||
safe_cast(siglapartido as string) sigla_partido, | ||
from `basedosdados-staging.br_camara_dados_abertos_staging.orgao_deputado` as t | ||
with | ||
orgao_deputado as ( | ||
select distinct | ||
regexp_extract(uriorgao, r'/orgaos/(\d+)') as id_orgao, | ||
safe_cast(nomeorgao as string) nome, | ||
safe_cast(siglaorgao as string) sigla, | ||
safe_cast(nomedeputado as string) nome_deputado, | ||
safe_cast(cargo as string) cargo, | ||
safe_cast(siglauf as string) sigla_uf, | ||
safe_cast(datainicio as date) data_inicio, | ||
safe_cast(datafim as date) data_final, | ||
safe_cast(siglapartido as string) sigla_partido, | ||
from `basedosdados-staging.br_camara_dados_abertos_staging.orgao_deputado` | ||
) | ||
select * | ||
from orgao_deputado | ||
where | ||
not ( | ||
nome_deputado = 'Hélio Leite' | ||
and cargo = 'Titular' | ||
and sigla_uf is null | ||
and data_inicio = '2022-05-03' | ||
and data_final = '2023-02-01' | ||
) |
2 changes: 1 addition & 1 deletion
2
models/br_camara_dados_abertos/br_camara_dados_abertos__proposicao_autor.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
models/br_mme_consumo_energia_eletrica/br_mme_consumo_energia_eletrica__uf.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{ | ||
config( | ||
alias="uf", | ||
schema="br_mme_consumo_energia_eletrica", | ||
materialized="table", | ||
) | ||
}} | ||
select | ||
safe_cast(ano as int64) as ano, | ||
safe_cast(mes as int64) as mes, | ||
safe_cast(sigla_uf as string) as sigla_uf, | ||
safe_cast(tipo_consumo as string) as tipo_consumo, | ||
case | ||
when numero_consumidores = '0' | ||
then null | ||
else safe_cast(numero_consumidores as int64) | ||
end as numero_consumidores, | ||
safe_cast(consumo as int64) as consumo | ||
from `basedosdados-staging.br_mme_consumo_energia_eletrica_staging.uf` as t |
Oops, something went wrong.