-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refatorar dataset veiculos
#126
base: main
Are you sure you want to change the base?
Conversation
…feitura-rio/pipelines_rj_smtr into staging/refatoracao-veiculos
Análise da árvore de códigoOs seguintes arquivos são afetados diretamente por alterações realizadas nesse pull request: |
@pixuimpou esse pull request tem conflitos 😩 |
@@ -10,7 +10,7 @@ SELECT | |||
WHEN DATE("{{ var('run_date') }}") >= "2024-03-16" AND DATE("{{ var('run_date') }}") < "2024-04-01" THEN DATE("2024-04-09") | |||
ELSE ( | |||
SELECT MIN(DATE(data)) | |||
FROM {{ ref("sppo_licenciamento_stu_staging") }} | |||
FROM {{ ref("licenciamento_stu_staging") }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As duas fontes precisam ser consideradas ou os dados precisam ser reprocessados no novo endereço
|
||
### Alterado | ||
- Altera tipo dos modelos `sppo_infracao.sql` e `sppo_licenciamento.sql` para `ephemeral` (https://github.com/prefeitura-rio/pipelines_rj_smtr/pull/126) | ||
- Adiciona colunas `placa`, `data_licenciamento`, `data_infracao` e `datetime_ultima_atualizacao` no modelo `sppo_veiculo_dia.sql` (https://github.com/prefeitura-rio/pipelines_rj_smtr/pull/126) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coluna tecnologia também
- name: data_licenciamento | ||
description: "Data do arquivo de licenciamento utilizado" | ||
- name: data_infracao | ||
description: "Data do arquivo de infrações utilizado" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Faltou a coluna de tecnologia
WHEN tipo_veiculo LIKE "%PDRON%" OR tipo_veiculo LIKE "%PADRON%" THEN "PADRON" | ||
WHEN tipo_veiculo LIKE "%ARTICULADO%" THEN "ARTICULADO" | ||
ELSE NULL | ||
END AS tecnologia, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Não era melhor isso estar no licenciamento?
@@ -253,6 +262,9 @@ SELECT | |||
WHEN indicadores.indicador_ar_condicionado IS TRUE THEN "Licenciado com ar e não autuado" | |||
ELSE NULL | |||
END AS status, | |||
DATE("{{ licenciamento_date }}") AS data_licenciamento, | |||
DATE("{{ infracao_date }}") AS data_infracao, | |||
CURRENT_DATETIME("America/Sao_Paulo") AS datetime_ultima_atualizacao, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Colunas novas incluir apenas > 2024-01-01
description: "Última atualização (GMT-3)." | ||
- name: versao | ||
description: "SHA do repositório no Github" | ||
- name: licenciamento | ||
description: "Tabela histórica de dados cadastrais dos veículos que operam o sistema de ônibus (BRT e SPPO), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retirar (BRT e SPPO)
FROM | ||
{{ ref("licenciamento") }} | ||
WHERE | ||
tipo_veiculo NOT LIKE "%ROD%" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incluir modo = 'ONIBUS'
FROM | ||
{{ ref("sppo_licenciamento") }} --`rj-smtr`.`veiculo`.`sppo_licenciamento` | ||
{{ ref("sppo_licenciamento") }} --`rj-smtr`.`veiculo`.`licenciamento` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrigir
@@ -126,8 +138,9 @@ WITH | |||
"025.VIII", | |||
"025.IX", | |||
"025.X", | |||
"025.XI") ), | |||
autuacao_limpeza AS ( | |||
"025.XI") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checar infrações
@@ -58,7 +58,7 @@ models: | |||
description: "Empresa ao qual o veículo está vinculado" | |||
- name: ano_ultima_vistoria | |||
description: "Ano da última vistoria realizada pelo veículo" | |||
- name: sppo_licenciamento_stu_staging | |||
- name: licenciamento_stu_staging | |||
description: "View de Dados cadastrais dos veículos que operam o sistema de ônibus (BRT e SPPO) no município do Rio de Janeiro.\n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retirar (BRT e SPPO)
Pipelines
Changelog - veiculo
[1.1.0] - 2024-08-06
Alterado
placa
das primary keysQueries
Changelog - veiculo
[2.0.0] - 2024-08-06
Adicionado
infracao.sql
elicenciamento.sql
para guardar os dados completos de infração e licenciamento do STUAlterado
sppo_infracao.sql
esppo_licenciamento.sql
paraephemeral
placa
,data_licenciamento
,data_infracao
edatetime_ultima_atualizacao
no modelosppo_veiculo_dia.sql