From 936b26575572bbb156552438b69149200b64324f Mon Sep 17 00:00:00 2001 From: Rodrigo Cunha <66736583+eng-rodrigocunha@users.noreply.github.com> Date: Mon, 3 Jun 2024 10:31:19 -0300 Subject: [PATCH] =?UTF-8?q?Cria=20par=C3=A2metro=20`project=5Fname`=20+=20?= =?UTF-8?q?Inclui=20argumento=20`run=5Fconfig`=20no=20flow=20`gtfs=5Fcaptu?= =?UTF-8?q?ra=5Ftratamento`=20(#678)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * commit inicial * Atualiza changelog * Adiciona run_config em referência ao flow principal ao criar as runs * Atualiza changelog * Enriquece logs * Remove log de informações sensíveis * Retora agente para produção * Altera SUBSIDIO_SPPO_CODE_OWNERS --- pipelines/constants.py | 4 ++++ pipelines/rj_smtr/br_rj_riodejaneiro_gtfs/CHANGELOG.md | 7 +++++++ pipelines/rj_smtr/br_rj_riodejaneiro_gtfs/flows.py | 8 ++++++-- pipelines/rj_smtr/constants.py | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/pipelines/constants.py b/pipelines/constants.py index d02486e5e..e585a0f5e 100644 --- a/pipelines/constants.py +++ b/pipelines/constants.py @@ -156,4 +156,8 @@ class constants(Enum): # pylint: disable=c0103 "user_id": "1147152438487416873", "type": "user_nickname", }, + "dados_smtr": { + "user_id": "1056928259700445245", + "type": "role", + }, } diff --git a/pipelines/rj_smtr/br_rj_riodejaneiro_gtfs/CHANGELOG.md b/pipelines/rj_smtr/br_rj_riodejaneiro_gtfs/CHANGELOG.md index 64d1027c2..bae22fcd8 100644 --- a/pipelines/rj_smtr/br_rj_riodejaneiro_gtfs/CHANGELOG.md +++ b/pipelines/rj_smtr/br_rj_riodejaneiro_gtfs/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog - br_rj_riodejaneiro_gtfs +## [1.0.1] - 2024-05-10 + +### Alterado + +- Cria parâmetro `project_name` no flow `gtfs_captura_tratamento` para possibilitar alterar o `project_name` ao usar a task `create_flow_run` (https://github.com/prefeitura-rio/pipelines/pull/678) +- Inclui argumento `run_config` ao usar a task `create_flow_run`, usando sempre como referência a `run_config` do flow principal (https://github.com/prefeitura-rio/pipelines/pull/678) + ## [1.0.0] - 2024-04-18 ### Adicionado diff --git a/pipelines/rj_smtr/br_rj_riodejaneiro_gtfs/flows.py b/pipelines/rj_smtr/br_rj_riodejaneiro_gtfs/flows.py index d86136327..1760e8e2f 100644 --- a/pipelines/rj_smtr/br_rj_riodejaneiro_gtfs/flows.py +++ b/pipelines/rj_smtr/br_rj_riodejaneiro_gtfs/flows.py @@ -66,6 +66,9 @@ data_versao_gtfs = Parameter("data_versao_gtfs", default=None) capture = Parameter("capture", default=True) materialize = Parameter("materialize", default=True) + project_name = Parameter( + "project_name", default=emd_constants.PREFECT_DEFAULT_PROJECT.value + ) timestamp = get_current_timestamp() @@ -84,7 +87,7 @@ run_captura = create_flow_run.map( flow_name=unmapped(gtfs_captura.name), - project_name=unmapped(emd_constants.PREFECT_DEFAULT_PROJECT.value), + project_name=unmapped(project_name), parameters=gtfs_capture_parameters, labels=unmapped(LABELS), scheduled_start_time=get_scheduled_start_times( @@ -92,6 +95,7 @@ parameters=gtfs_capture_parameters, intervals={"agency": timedelta(minutes=11)}, ), + run_config=unmapped(gtfs_captura_tratamento.run_config), ) wait_captura_true = wait_for_flow_run.map( @@ -120,7 +124,7 @@ run_materializacao = create_flow_run( flow_name=gtfs_materializacao.name, - project_name=emd_constants.PREFECT_DEFAULT_PROJECT.value, + project_name=project_name, parameters=gtfs_materializacao_parameters, labels=LABELS, upstream_tasks=[wait_captura], diff --git a/pipelines/rj_smtr/constants.py b/pipelines/rj_smtr/constants.py index 9187820f8..cb3393d12 100644 --- a/pipelines/rj_smtr/constants.py +++ b/pipelines/rj_smtr/constants.py @@ -161,7 +161,7 @@ class constants(Enum): # pylint: disable=c0103 SUBSIDIO_SPPO_DATASET_ID = "projeto_subsidio_sppo" SUBSIDIO_SPPO_SECRET_PATH = "projeto_subsidio_sppo" SUBSIDIO_SPPO_TABLE_ID = "viagem_completa" - SUBSIDIO_SPPO_CODE_OWNERS = ["rodrigo"] + SUBSIDIO_SPPO_CODE_OWNERS = ["dados_smtr"] # SUBSÍDIO DASHBOARD SUBSIDIO_SPPO_DASHBOARD_DATASET_ID = "dashboard_subsidio_sppo"