Skip to content

Commit

Permalink
Merge branch 'main' into staging/atualiza-redis
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Jan 6, 2025
2 parents e518688 + 76a9e78 commit 524c5f8
Show file tree
Hide file tree
Showing 9 changed files with 397 additions and 300 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.7] - 2025-01-03

### Adicionado

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

## [1.0.6] - 2024-12-17

### Adicionado
Expand Down
18 changes: 18 additions & 0 deletions pipelines/migration/projeto_subsidio_sppo/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,18 @@
_vars=dbt_vars_2,
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"},
upstream_tasks=[SUBSIDIO_SPPO_APURACAO_RUN_2],
)[0]

SUBSIDIO_SPPO_APURACAO_RUN_3 = run_dbt_selector(
selector_name="monitoramento_subsidio",
_vars=dbt_vars_3,
upstream_tasks=[dbt_vars_3],
)

# POST-DATA QUALITY CHECK #
SUBSIDIO_SPPO_DATA_QUALITY_POS_2 = run_dbt_tests(
Expand Down Expand Up @@ -323,6 +335,11 @@
_vars=_vars,
)

SUBSIDIO_SPPO_APURACAO_RUN_2 = run_dbt_selector(
selector_name="monitoramento_subsidio",
_vars=_vars | {"tipo_materializacao": "monitoramento"},
upstream_tasks=[SUBSIDIO_SPPO_APURACAO_RUN],
)
# POST-DATA QUALITY CHECK #
SUBSIDIO_SPPO_DATA_QUALITY_POS = run_dbt_tests(
dataset_id="viagens_remuneradas sumario_servico_dia_pagamento",
Expand Down Expand Up @@ -373,6 +390,7 @@
dataset_id="sppo_registros sppo_realocacao check_gps_treatment__gps_sppo sppo_veiculo_dia", # noqa
_vars=dbt_vars,
)

DATA_QUALITY_PRE = dbt_data_quality_checks(
dbt_logs=SUBSIDIO_SPPO_DATA_QUALITY_PRE,
checks_list={},
Expand Down
1 change: 1 addition & 0 deletions queries/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ vars:
subsidio_parametros: "`rj-smtr-staging.dashboard_subsidio_sppo_staging.subsidio_parametros`"
shapes_version: "YYYY-MM-DD"
frequencies_version: "YYYY-MM-DD"
tipo_materializacao: "subsidio"
# Feature penalidade de autuação por inoperância do ar condicionado (DECRETO RIO 51940/2023)
DATA_SUBSIDIO_V2_INICIO: "2023-01-16"
# Feature penalidade de autuação por segurança e limpeza/equipamento (DECRETO RIO 52820/2023)
Expand Down
5 changes: 5 additions & 0 deletions queries/models/monitoramento/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog - monitoramento

## [1.2.1] - 2025-01-03

### Adicionado
- Cria modelo `monitoramento_viagem_transacao.sql` (https://github.com/prefeitura-rio/pipelines_rj_smtr/pull/372)

## [1.2.0] - 2024-11-28

### Adicionado
Expand Down
26 changes: 26 additions & 0 deletions queries/models/monitoramento/monitoramento_viagem_transacao.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{
config(
materialized="incremental",
partition_by={"field": "data", "data_type": "date", "granularity": "day"},
incremental_strategy="insert_overwrite",
)
}}

select
data,
id_viagem,
id_veiculo,
id_validador,
servico,
tipo_viagem,
sentido,
distancia_planejada,
quantidade_transacao,
quantidade_transacao_riocard,
percentual_estado_equipamento_aberto,
indicador_estado_equipamento_aberto,
datetime_partida_bilhetagem,
datetime_partida,
datetime_chegada,
datetime_ultima_atualizacao
from {{ ref('viagem_transacao_aux') }}
10 changes: 10 additions & 0 deletions queries/models/subsidio/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog - subsidio

## [2.0.1] - 2025-01-06

# Corrigido

- Corrigido e refatorado o modelo `viagem_transacao.sql` (https://github.com/prefeitura-rio/pipelines_rj_smtr/pull/372)

# Adicionado

- Adicionado o modelo `viagem_transacao_aux.sql`(https://github.com/prefeitura-rio/pipelines_rj_smtr/pull/372)

## [2.0.0] - 2024-12-06

# Corrigido
Expand Down
Loading

0 comments on commit 524c5f8

Please sign in to comment.