Skip to content

Commit

Permalink
[HOTFIX] Anexo faixa horária (#209)
Browse files Browse the repository at this point in the history
* adiciona faixa de 00 a 03 para sabado, domingo e ponto facultativo

* registra flow
  • Loading branch information
akaBotelho committed Sep 12, 2024
1 parent db29bb8 commit 698f370
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 0 additions & 1 deletion pipelines/migration/br_rj_riodejaneiro_gtfs/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Flows for gtfs
DBT: 2024-09-10
"""

from prefect import Parameter, case, task
Expand Down
4 changes: 4 additions & 0 deletions pipelines/migration/br_rj_riodejaneiro_gtfs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,8 @@ def processa_ordem_servico_faixa_horaria(sheetnames, file_bytes, local_filepath,
"Quilometragem entre 21h e 24h — Domingo": "quilometragem_entre_21h_e_24h_domingo",
"Partidas entre 24h e 03h (dia seguinte) — Domingo": "partidas_entre_24h_e_03h_diaseguinte_domingo", # noqa
"Quilometragem entre 24h e 03h (dia seguinte) — Domingo": "quilometragem_entre_24h_e_03h_diaseguinte_domingo", # noqa
"Partidas entre 00h e 03h — Ponto Facultativo": "partidas_entre_00h_e_03h_ponto_facultativo", # noqa
"Quilometragem entre 00h e 03h — Ponto Facultativo": "quilometragem_entre_00h_e_03h_ponto_facultativo", # noqa
"Partidas entre 03h e 12h — Ponto Facultativo": "partidas_entre_03h_e_12h_ponto_facultativo", # noqa
"Quilometragem entre 03h e 12h — Ponto Facultativo": "quilometragem_entre_03h_e_12h_ponto_facultativo", # noqa
"Partidas entre 12h e 21h — Ponto Facultativo": "partidas_entre_12h_e_21h_ponto_facultativo", # noqa
Expand Down Expand Up @@ -522,6 +524,8 @@ def processa_ordem_servico_faixa_horaria(sheetnames, file_bytes, local_filepath,
"Quilometragem entre 21h e 24h (Domingo)": "quilometragem_entre_21h_e_24h_domingo",
"Partidas entre 24h e 03h (dia seguinte) (Domingo)": "partidas_entre_24h_e_03h_diaseguinte_domingo", # noqa
"Quilometragem entre 24h e 03h (dia seguinte) (Domingo)": "quilometragem_entre_24h_e_03h_diaseguinte_domingo", # noqa
"Partidas entre 00h e 03h (Ponto Facultativo)": "partidas_entre_00h_e_03h_ponto_facultativo", # noqa
"Quilometragem entre 00h e 03h (Ponto Facultativo)": "quilometragem_entre_00h_e_03h_ponto_facultativo", # noqa
"Partidas entre 03h e 12h (Ponto Facultativo)": "partidas_entre_03h_e_12h_ponto_facultativo", # noqa
"Quilometragem entre 03h e 12h (Ponto Facultativo)": "quilometragem_entre_03h_e_12h_ponto_facultativo", # noqa
"Partidas entre 12h e 21h (Ponto Facultativo)": "partidas_entre_12h_e_21h_ponto_facultativo", # noqa
Expand Down
12 changes: 12 additions & 0 deletions queries/models/planejamento/ordem_servico_faixa_horaria.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ WITH
SAFE_CAST(JSON_VALUE(content, '$.quilometragem_entre_21h_e_24h_dias_uteis') AS STRING) AS quilometragem_entre_21h_e_24h_dias_uteis,
SAFE_CAST(JSON_VALUE(content, '$.partidas_entre_24h_e_03h_diaseguinte_dias_uteis') AS STRING) AS partidas_entre_24h_e_03h_diaseguinte_dias_uteis,
SAFE_CAST(JSON_VALUE(content, '$.quilometragem_entre_24h_e_03h_diaseguinte_dias_uteis') AS STRING) AS quilometragem_entre_24h_e_03h_diaseguinte_dias_uteis,
SAFE_CAST(JSON_VALUE(content, '$.partidas_entre_00h_e_03h_sabado') AS STRING) AS partidas_entre_00h_e_03h_sabado,
SAFE_CAST(JSON_VALUE(content, '$.quilometragem_entre_00h_e_03h_sabado') AS STRING) AS quilometragem_entre_00h_e_03h_sabado,
SAFE_CAST(JSON_VALUE(content, '$.partidas_entre_03h_e_12h_sabado') AS STRING) AS partidas_entre_03h_e_12h_sabado,
SAFE_CAST(JSON_VALUE(content, '$.quilometragem_entre_03h_e_12h_sabado') AS STRING) AS quilometragem_entre_03h_e_12h_sabado,
SAFE_CAST(JSON_VALUE(content, '$.partidas_entre_12h_e_21h_sabado') AS STRING) AS partidas_entre_12h_e_21h_sabado,
Expand All @@ -33,6 +35,8 @@ WITH
SAFE_CAST(JSON_VALUE(content, '$.quilometragem_entre_21h_e_24h_sabado') AS STRING) AS quilometragem_entre_21h_e_24h_sabado,
SAFE_CAST(JSON_VALUE(content, '$.partidas_entre_24h_e_03h_diaseguinte_sabado') AS STRING) AS partidas_entre_24h_e_03h_diaseguinte_sabado,
SAFE_CAST(JSON_VALUE(content, '$.quilometragem_entre_24h_e_03h_diaseguinte_sabado') AS STRING) AS quilometragem_entre_24h_e_03h_diaseguinte_sabado,
SAFE_CAST(JSON_VALUE(content, '$.partidas_entre_00h_e_03h_domingo') AS STRING) AS partidas_entre_00h_e_03h_domingo,
SAFE_CAST(JSON_VALUE(content, '$.quilometragem_entre_00h_e_03h_domingo') AS STRING) AS quilometragem_entre_00h_e_03h_domingo,
SAFE_CAST(JSON_VALUE(content, '$.partidas_entre_03h_e_12h_domingo') AS STRING) AS partidas_entre_03h_e_12h_domingo,
SAFE_CAST(JSON_VALUE(content, '$.quilometragem_entre_03h_e_12h_domingo') AS STRING) AS quilometragem_entre_03h_e_12h_domingo,
SAFE_CAST(JSON_VALUE(content, '$.partidas_entre_12h_e_21h_domingo') AS STRING) AS partidas_entre_12h_e_21h_domingo,
Expand All @@ -41,6 +45,8 @@ WITH
SAFE_CAST(JSON_VALUE(content, '$.quilometragem_entre_21h_e_24h_domingo') AS STRING) AS quilometragem_entre_21h_e_24h_domingo,
SAFE_CAST(JSON_VALUE(content, '$.partidas_entre_24h_e_03h_diaseguinte_domingo') AS STRING) AS partidas_entre_24h_e_03h_diaseguinte_domingo,
SAFE_CAST(JSON_VALUE(content, '$.quilometragem_entre_24h_e_03h_diaseguinte_domingo') AS STRING) AS quilometragem_entre_24h_e_03h_diaseguinte_domingo,
SAFE_CAST(JSON_VALUE(content, '$.partidas_entre_00h_e_03h_ponto_facultativo') AS STRING) AS partidas_entre_00h_e_03h_ponto_facultativo,
SAFE_CAST(JSON_VALUE(content, '$.quilometragem_entre_00h_e_03h_ponto_facultativo') AS STRING) AS quilometragem_entre_00h_e_03h_ponto_facultativo,
SAFE_CAST(JSON_VALUE(content, '$.partidas_entre_03h_e_12h_ponto_facultativo') AS STRING) AS partidas_entre_03h_e_12h_ponto_facultativo,
SAFE_CAST(JSON_VALUE(content, '$.quilometragem_entre_03h_e_12h_ponto_facultativo') AS STRING) AS quilometragem_entre_03h_e_12h_ponto_facultativo,
SAFE_CAST(JSON_VALUE(content, '$.partidas_entre_12h_e_21h_ponto_facultativo') AS STRING) AS partidas_entre_12h_e_21h_ponto_facultativo,
Expand Down Expand Up @@ -113,6 +119,8 @@ WITH
quilometragem_entre_21h_e_24h_dias_uteis,
partidas_entre_24h_e_03h_diaseguinte_dias_uteis,
quilometragem_entre_24h_e_03h_diaseguinte_dias_uteis,
partidas_entre_00h_e_03h_sabado,
quilometragem_entre_00h_e_03h_sabado,
partidas_entre_03h_e_12h_sabado,
quilometragem_entre_03h_e_12h_sabado,
partidas_entre_12h_e_21h_sabado,
Expand All @@ -121,6 +129,8 @@ WITH
quilometragem_entre_21h_e_24h_sabado,
partidas_entre_24h_e_03h_diaseguinte_sabado,
quilometragem_entre_24h_e_03h_diaseguinte_sabado,
partidas_entre_00h_e_03h_domingo,
quilometragem_entre_00h_e_03h_domingo,
partidas_entre_03h_e_12h_domingo,
quilometragem_entre_03h_e_12h_domingo,
partidas_entre_12h_e_21h_domingo,
Expand All @@ -129,6 +139,8 @@ WITH
quilometragem_entre_21h_e_24h_domingo,
partidas_entre_24h_e_03h_diaseguinte_domingo,
quilometragem_entre_24h_e_03h_diaseguinte_domingo,
partidas_entre_00h_e_03h_ponto_facultativo,
quilometragem_entre_00h_e_03h_ponto_facultativo,
partidas_entre_03h_e_12h_ponto_facultativo,
quilometragem_entre_03h_e_12h_ponto_facultativo,
partidas_entre_12h_e_21h_ponto_facultativo,
Expand Down

0 comments on commit 698f370

Please sign in to comment.