From 1f8545561ebcb51c2f6b7d0a7fd09dd8b6506f42 Mon Sep 17 00:00:00 2001 From: Rafael Carvalho Pinheiro <74972217+pixuimpou@users.noreply.github.com> Date: Fri, 17 May 2024 09:46:12 -0300 Subject: [PATCH] =?UTF-8?q?Bilhetagem=20-=20Criar=20flow=20de=20valida?= =?UTF-8?q?=C3=A7=C3=A3o=20dos=20dados=20da=20Ja=C3=A9=20(#682)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit criar flow de materialização de validação da jaé --- .../br_rj_riodejaneiro_bilhetagem/flows.py | 19 +++++++++++++++++++ pipelines/rj_smtr/constants.py | 11 +++++++++++ 2 files changed, 30 insertions(+) diff --git a/pipelines/rj_smtr/br_rj_riodejaneiro_bilhetagem/flows.py b/pipelines/rj_smtr/br_rj_riodejaneiro_bilhetagem/flows.py index ffeb9806c..cf5580e61 100644 --- a/pipelines/rj_smtr/br_rj_riodejaneiro_bilhetagem/flows.py +++ b/pipelines/rj_smtr/br_rj_riodejaneiro_bilhetagem/flows.py @@ -40,6 +40,7 @@ every_hour, every_minute, every_day_hour_five, + every_day_hour_seven, every_5_minutes, ) @@ -306,6 +307,24 @@ bilhetagem_materializacao_gps_validador.state_handlers.append(skip_if_running_handler) +# Validação dos dados + +bilhetagem_validacao_jae = deepcopy(default_materialization_flow) +bilhetagem_validacao_jae.name = "SMTR: Bilhetagem Validação Jaé - Materialização" + +bilhetagem_validacao_jae.run_config = KubernetesRun( + image=emd_constants.DOCKER_IMAGE.value, + labels=[emd_constants.RJ_SMTR_AGENT_LABEL.value], +) + +bilhetagem_validacao_jae = set_default_parameters( + flow=bilhetagem_validacao_jae, + default_parameters=constants.BILHETAGEM_MATERIALIZACAO_GPS_VALIDADOR_GENERAL_PARAMS.value, +) + +bilhetagem_validacao_jae.schedule = every_day_hour_seven + + # RECAPTURA # bilhetagem_recaptura = deepcopy(default_capture_flow) diff --git a/pipelines/rj_smtr/constants.py b/pipelines/rj_smtr/constants.py index c979a181a..cf2348936 100644 --- a/pipelines/rj_smtr/constants.py +++ b/pipelines/rj_smtr/constants.py @@ -1277,6 +1277,17 @@ class constants(Enum): # pylint: disable=c0103 "source_type": BILHETAGEM_GENERAL_CAPTURE_PARAMS["source_type"], } + BILHETAGEM_MATERIALIZACAO_VALIDACAO_JAE_PARAMS = { + "dataset_id": "validacao_dados_jae", + "upstream": True, + "exclude": "+gps_sppo +sppo_veiculo_dia +gps_validador +transacao\ ++ordem_pagamento_dia +integracao +servicos", + "dbt_vars": { + "run_date": {}, + "version": {}, + }, + } + # GTFS GTFS_DATASET_ID = "gtfs"