Skip to content

Commit

Permalink
[Subsídio] Incorpora novo teste para verificar se as viagens foram pr…
Browse files Browse the repository at this point in the history
…ocessadas com o feed correto do GTFS (#703)

* commit inicial

* Atualiza changelog

* Atualiza nome do teste

* Ajusta colunas do teste `check_trips_processing` e atualiza changelog

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
eng-rodrigocunha and mergify[bot] authored Jun 21, 2024
1 parent a449316 commit ce1b587
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
34 changes: 34 additions & 0 deletions pipelines/rj_smtr/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,37 @@ class constants(Enum): # pylint: disable=c0103
SUBSIDIO_SPPO_DASHBOARD_STAGING_DATASET_ID = "dashboard_subsidio_sppo_staging"
SUBSIDIO_SPPO_DASHBOARD_TABLE_ID = "sumario_servico_dia"
SUBSIDIO_SPPO_DATA_CHECKS_PARAMS = {
"check_trips_processing": {
"query": """SELECT
s.data,
s.tipo_dia,
s.subtipo_dia,
s.tipo_os,
s.feed_version,
s.feed_start_date AS feed_start_date_invalido,
i.feed_start_date AS feed_start_date_valido,
FROM (
SELECT
*
FROM
rj-smtr.projeto_subsidio_sppo.subsidio_data_versao_efetiva
WHERE
DATA >= "2024-04-01" -- DATA_SUBSIDIO_V6_INICIO (Feature trajetos alternativos)
AND DATA BETWEEN DATE("{start_timestamp}")
AND DATE("{end_timestamp}")
) AS s
LEFT JOIN
rj-smtr.gtfs.feed_info AS i
ON
(DATA BETWEEN i.feed_start_date
AND i.feed_end_date
OR (DATA >= i.feed_start_date
AND i.feed_end_date IS NULL))
WHERE
i.feed_start_date != s.feed_start_date
""",
"order_columns": ["data"],
},
"check_gps_capture": {
"query": """WITH
t AS (
Expand Down Expand Up @@ -565,6 +596,9 @@ class constants(Enum): # pylint: disable=c0103
"Todos os dados de status dos veículos foram devidamente tratados": {
"test": "check_sppo_veiculo_dia",
},
"Todos os dados de viagens foram tratados com o respectivo feed correto do GTFS": {
"test": "check_trips_processing",
},
}
}
SUBSIDIO_SPPO_DATA_CHECKS_POS_LIST = {
Expand Down
7 changes: 7 additions & 0 deletions pipelines/rj_smtr/projeto_subsidio_sppo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog - projeto_subsidio_sppo

## [1.0.1] - 2024-06-17

### Alterado

- Incorpora novo teste `check_trips_processing` para verificar se as viagens foram processadas com o feed correto do GTFS (https://github.com/prefeitura-rio/pipelines/pull/703)


## [1.0.0] - 2024-04-18

### Alterado
Expand Down

0 comments on commit ce1b587

Please sign in to comment.