Skip to content

Commit

Permalink
Merge branch 'main' into staging/migra-captura-manual-gtfs
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Jul 17, 2024
2 parents 687749c + 112af25 commit effa618
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pipelines/migration/br_rj_riodejaneiro_bilhetagem/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Flows for br_rj_riodejaneiro_bilhetagem
DBT: 2024-07-17 2
DBT: 2024-07-17 3
"""

from copy import deepcopy
Expand Down
5 changes: 5 additions & 0 deletions queries/models/dashboard_bilhetagem_jae/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog - dashboard_bilhetagem_jae

## [1.0.1] - 2024-07-17

### Corrigido
- Deduplica ids dos serviços (https://github.com/prefeitura-rio/pipelines_rj_smtr/pull/109)

## [1.0.0] - 2024-06-11

### Adicionado
Expand Down
18 changes: 16 additions & 2 deletions queries/models/dashboard_bilhetagem_jae/view_integracao.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
WITH dados_filtrados AS (
WITH servicos AS (
SELECT
* EXCEPT(rn)
FROM
(
SELECT
*,
ROW_NUMBER() OVER (PARTITION BY id_servico_jae ORDER BY data_inicio_vigencia) AS rn
FROM
{{ ref("servicos") }}
)
WHERE
rn = 1
),
dados_filtrados AS (
SELECT
i.data,
i.hora,
Expand All @@ -11,7 +25,7 @@ WITH dados_filtrados AS (
FROM
{{ ref("integracao") }} i
LEFT JOIN
{{ ref("servicos") }} s
servicos s
USING(id_servico_jae)
WHERE
data >= "2024-02-24"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
-- depends_on: {{ ref('view_passageiros_tile_hora') }}
WITH servicos AS (
SELECT
* EXCEPT(rn)
FROM
(
SELECT
*,
ROW_NUMBER() OVER (PARTITION BY id_servico_jae ORDER BY data_inicio_vigencia) AS rn
FROM
{{ ref("servicos") }}
)
WHERE
rn = 1
)
SELECT
p.data,
p.hora,
Expand All @@ -20,5 +34,5 @@ SELECT
FROM
{{ ref("passageiros_hora") }} p
LEFT JOIN
{{ ref("servicos") }} s
servicos s
USING(id_servico_jae)
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
WITH servicos AS (
SELECT
* EXCEPT(rn)
FROM
(
SELECT
*,
ROW_NUMBER() OVER (PARTITION BY id_servico_jae ORDER BY data_inicio_vigencia) AS rn
FROM
{{ ref("servicos") }}
)
WHERE
rn = 1
)
SELECT
p.data,
p.hora,
Expand All @@ -18,5 +32,5 @@ SELECT
FROM
{{ ref("passageiros_tile_hora") }} p
LEFT JOIN
{{ ref("servicos") }} s
servicos s
USING(id_servico_jae)

0 comments on commit effa618

Please sign in to comment.