Skip to content
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

[Subsídio] Incorpora novo teste para verificar se as viagens foram processadas com o feed correto do GTFS #703

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading