-
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 staging/br_ms_sia
- Loading branch information
Showing
3 changed files
with
107 additions
and
48 deletions.
There are no files selected for viewing
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' | ||
) |
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