Skip to content

Commit

Permalink
Merge branch 'main' into staging/transacao-2-0
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Jan 21, 2025
2 parents 00f38e2 + ae441b5 commit cf8ee45
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 11 deletions.
6 changes: 6 additions & 0 deletions pipelines/migration/projeto_subsidio_sppo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog - projeto_subsidio_sppo

## [1.0.8] - 2025-01-03

### Corrigido

- corrigida a materialização dos modelos do dataset `monitoramento` no flow do subsídio (https://github.com/prefeitura-rio/pipelines_rj_smtr/pull/391)

## [1.0.7] - 2025-01-03

### Adicionado
Expand Down
15 changes: 10 additions & 5 deletions pipelines/migration/projeto_subsidio_sppo/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,8 @@
upstream_tasks=[dbt_vars_2],
)
dbt_vars_3 = get_join_dict(
dict_list=[dbt_vars_1],
new_dict=date_intervals["second_range"]
| {"tipo_materializacao": "monitoramento"},
dict_list=[dbt_vars_2],
new_dict={"tipo_materializacao": "monitoramento"},
upstream_tasks=[SUBSIDIO_SPPO_APURACAO_RUN_2],
)[0]

Expand Down Expand Up @@ -335,10 +334,16 @@
_vars=_vars,
)

_vars_2 = get_join_dict(
dict_list=[_vars],
new_dict={"tipo_materializacao": "monitoramento"},
upstream_tasks=[SUBSIDIO_SPPO_APURACAO_RUN],
)[0]

SUBSIDIO_SPPO_APURACAO_RUN_2 = run_dbt_selector(
selector_name="monitoramento_subsidio",
_vars=_vars | {"tipo_materializacao": "monitoramento"},
upstream_tasks=[SUBSIDIO_SPPO_APURACAO_RUN],
_vars=_vars_2,
upstream_tasks=[_vars_2],
)
# POST-DATA QUALITY CHECK #
SUBSIDIO_SPPO_DATA_QUALITY_POS = run_dbt_tests(
Expand Down
2 changes: 2 additions & 0 deletions pipelines/migration/veiculo/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# pylint: disable=W0511
"""
Flows for veiculos
DBT: 2025-01-21
"""

from copy import deepcopy
Expand Down
4 changes: 2 additions & 2 deletions queries/models/sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ sources:
- name: sppo_vistoria_tr_subtt_cglf_2024
- name: sppo_vistoria_tr_subtt_cglf_pendentes_2024
- name: sppo_registro_agente_verao
- name: sppo_infracao
- name: sppo_licenciamento_solicitacao
- name: sppo_licenciamento
- name: sppo_licenciamento_stu
- name: infracao
- name: licenciamento_stu

- name: dashboard_subsidio_sppo_staging
database: rj-smtr-staging
Expand Down
5 changes: 5 additions & 0 deletions queries/models/veiculo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog - veiculo

## [2.0.1] - 2025-01-21

### Corrigido
- Corrigido os sources dos modelos `infracao.sql` e `licenciamento.sql` (https://github.com/prefeitura-rio/pipelines_rj_smtr/pull/391)

## [2.0.0] - 2025-01-16

### Adicionado
Expand Down
4 changes: 2 additions & 2 deletions queries/models/veiculo/sppo_veiculo_dia.sql
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ gps AS (
DISTINCT data,
id_veiculo
FROM
-- {{ ref("gps_sppo") }}
`rj-smtr.br_rj_riodejaneiro_veiculos.gps_sppo`
{{ ref("gps_sppo") }}
-- `rj-smtr.br_rj_riodejaneiro_veiculos.gps_sppo`
WHERE
data = DATE("{{ var('run_date') }}") ),
autuacoes AS (
Expand Down
2 changes: 1 addition & 1 deletion queries/models/veiculo/staging/infracao_staging.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ SELECT
IF(JSON_VALUE(content,'$.data_pagamento') = "", NULL, PARSE_DATE("%d/%m/%Y", JSON_VALUE(content,'$.data_pagamento'))) data_pagamento,
SAFE_CAST(DATETIME(TIMESTAMP_TRUNC(TIMESTAMP(timestamp_captura), SECOND), "America/Sao_Paulo" ) AS DATETIME) timestamp_captura
FROM
{{ source('veiculo_staging','sppo_infracao') }} as t
{{ source('veiculo_staging','infracao') }} as t

Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ SELECT
SAFE_CAST(PARSE_DATETIME("%d/%m/%Y", JSON_VALUE(content,"$.data_inicio_vinculo")) AS DATE)
END AS data_inicio_vinculo,
FROM
{{ source('veiculo_staging','sppo_licenciamento_stu') }} as t
{{ source('veiculo_staging','licenciamento_stu') }} as t

0 comments on commit cf8ee45

Please sign in to comment.