Skip to content

Commit

Permalink
Atualizar segundo turno resultados_partido_municipio_zona
Browse files Browse the repository at this point in the history
  • Loading branch information
Winzen committed Nov 12, 2024
1 parent e519e50 commit bbf5d82
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 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 @@ -15,7 +15,9 @@
select
safe_cast(ano as int64) ano,
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 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 @@ -24,5 +26,5 @@ select
safe_cast(numero_partido as string) numero_partido,
safe_cast(sigla_partido as string) sigla_partido,
safe_cast(votos_nominais as int64) votos_nominais,
safe_cast(votos_nao_nominais as int64) votos_nao_nominais
safe_cast(votos_legenda as int64) votos_legenda
from `basedosdados-dev.br_tse_eleicoes_staging.resultados_partido_municipio_zona` as t
20 changes: 19 additions & 1 deletion models/br_tse_eleicoes/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1495,7 +1495,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 @@ -1507,18 +1507,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 bbf5d82

Please sign in to comment.