Skip to content

Commit

Permalink
Adicionar modelos resultados_partido_municipio e resultados_partido_m…
Browse files Browse the repository at this point in the history
…unicipio_zona, junto testes
  • Loading branch information
Winzen committed Oct 28, 2024
1 parent 76a7d3f commit ee38a5c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ select
safe_cast(sigla_partido as string) sigla_partido,
safe_cast(votos_nominais as int64) votos_nominais,
safe_cast(votos_legenda as int64) votos_legenda
from `basedosdados-dev.br_tse_eleicoes_staging.resultados_partido_municipio` as t
from `basedosdados-staging.br_tse_eleicoes_staging.resultados_partido_municipio` as t
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
partition_by={
"field": "ano",
"data_type": "int64",
"range": {"start": 1994, "end": 2022, "interval": 2},
"range": {"start": 1994, "end": 2024, "interval": 2},
},
cluster_by=["sigla_uf"],
)
Expand All @@ -17,7 +17,7 @@ select
safe_cast(turno as int64) turno,
safe_cast(id_eleicao as string) id_eleicao,
safe_cast(tipo_eleicao as string) tipo_eleicao,
safe_cast(data_eleicao as string) data_eleicao,
safe_cast(data_eleicao as date) data_eleicao,
safe_cast(sigla_uf as string) sigla_uf,
safe_cast(id_municipio as string) id_municipio,
safe_cast(id_municipio_tse as string) id_municipio_tse,
Expand Down
25 changes: 24 additions & 1 deletion models/br_tse_eleicoes/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1478,6 +1478,11 @@ models:
description: Sigla do partido
- name: sigla_uf
description: Sigla da unidade da federação
tests:
- custom_relationships:
to: ref('br_bd_diretorios_brasil__uf')
field: sigla
ignore_values: [GB, GP, RB]
- name: tipo_eleicao
description: Tipo da eleição
- name: turno
Expand All @@ -1499,7 +1504,7 @@ models:
- cargo
- numero_partido
- not_null_proportion_multiple_columns:
at_least: 0.95
at_least: 0.90
columns:
- name: ano
description: Ano
Expand All @@ -1511,18 +1516,36 @@ models:
description: Cargo
- name: data_eleicao
description: Data da eleição
tests:
- relationships:
to: ref('br_bd_diretorios_data_tempo__data')
field: data.data
- name: id_eleicao
description: ID Eleição
- name: id_municipio
description: ID Município - IBGE 7 Dígitos
tests:
- relationships:
to: ref('br_bd_diretorios_brasil__municipio')
field: id_municipio
- name: id_municipio_tse
description: ID Município - TSE
tests:
- custom_relationships:
to: ref('br_bd_diretorios_brasil__municipio')
field: id_municipio_tse
ignore_values: ['73709']
- name: numero_partido
description: Número do partido
- name: sigla_partido
description: Sigla do partido
- name: sigla_uf
description: Sigla da unidade da federação
tests:
- custom_relationships:
to: ref('br_bd_diretorios_brasil__uf')
field: sigla
ignore_values: [GB, GP, RB]
- name: tipo_eleicao
description: Tipo da eleição
- name: turno
Expand Down

0 comments on commit ee38a5c

Please sign in to comment.