Skip to content

Commit

Permalink
Merge pull request #610 from basedosdados/staging/br_tse_eleicoes
Browse files Browse the repository at this point in the history
[fix]br_tse_eleicoes Adicionar teste em receitas_orgao_partidario e receitas_comite
  • Loading branch information
Winzen authored Sep 17, 2024
2 parents 39839af + ace3c40 commit b5b8455
Show file tree
Hide file tree
Showing 4 changed files with 170 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ select
else null
end as cnae_2_fornecedor_classe,
case
when length(cnae_2_fornecedor) > 5
when length(cnae_2_fornecedor) = 7
then safe_cast(cnae_2_fornecedor as string)
else null
end as cnae_2_fornecedor_subclasse,
Expand Down
6 changes: 6 additions & 0 deletions models/br_tse_eleicoes/br_tse_eleicoes__receitas_comite.sql
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ select
safe_cast(numero_partido_doador as string) numero_partido_doador,
safe_cast(numero_candidato_doador as string) numero_candidato_doador,
safe_cast(cnae_2_doador as string) cnae_2_doador,
case
when length(cnae_2_doador) = 5 then safe_cast(cnae_2_doador as string) else null
end as cnae_2_doador_classe,
case
when length(cnae_2_doador) > 5 then safe_cast(cnae_2_doador as string) else null
end as cnae_2_doador_subclasse,
safe_cast(descricao_cnae_2_doador as string) descricao_cnae_2_doador,
safe_cast(cpf_cnpj_doador_orig as string) cpf_cnpj_doador_orig,
safe_cast(nome_doador_orig as string) nome_doador_orig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ select
safe_cast(descricao_receita as string) descricao_receita,
safe_cast(sequencial_receita as string) sequencial_receita,
safe_cast(cnae_2_doador as string) cnae_2_doador,
case
when length(cnae_2_doador) = 5 then safe_cast(cnae_2_doador as string) else null
end as cnae_2_doador_classe,
case
when length(cnae_2_doador) > 5 then safe_cast(cnae_2_doador as string) else null
end as cnae_2_doador_subclasse,
safe_cast(descricao_cnae_2_doador as string) descricao_cnae_2_doador,
safe_cast(cpf_cnpj_doador as string) cpf_cnpj_doador,
safe_cast(nome_doador as string) nome_doador,
Expand Down
Loading

0 comments on commit b5b8455

Please sign in to comment.