Skip to content

Commit

Permalink
Adicionar br_tse_eleicoes__resultados_partido_municipio e testes
Browse files Browse the repository at this point in the history
  • Loading branch information
Winzen committed Oct 28, 2024
1 parent 7dcbec3 commit 76a7d3f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
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 All @@ -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-staging.br_tse_eleicoes_staging.resultados_partido_municipio` as t
from `basedosdados-dev.br_tse_eleicoes_staging.resultados_partido_municipio` as t
15 changes: 14 additions & 1 deletion models/br_tse_eleicoes/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,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 @@ -1453,12 +1453,25 @@ 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
Expand Down

0 comments on commit 76a7d3f

Please sign in to comment.