-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cria validação dos dados de integração da Jaé com base na Matriz da S…
…MTR (#371) * cria nova validação de integrações * add data_inicio_matriz * cria tabela matriz_integracao com base na matriz da smtr * corrige integração com transação duplicada * cria validação das integrações usando a matriz da smtr * cria flow de materialização da nova validação dos dados da Jaé * schedule_cron opcional * cria materialização da matriz de integração da smtr * add matriz_integracao_smtr / add validacao_dados_jae * add validacao_dados_jae * wait integracao e transacao * add change log pr 371 * ajusta schedule * corrige mensagem de erro * descomenta refs --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
3081fd0
commit ee19094
Showing
30 changed files
with
866 additions
and
501 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
pipelines/migration/br_rj_riodejaneiro_bilhetagem/CHANGELOG.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Changelog - validacao_dados_jae | ||
|
||
## [1.0.0] - 2024-12-30 | ||
|
||
### Adicionado | ||
|
||
- Cria flow de materialização da validação dos dados da Jaé (https://github.com/prefeitura-rio/pipelines_rj_smtr/pull/371) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Valores constantes para materialização da validação dos dados da Jaé | ||
""" | ||
|
||
from datetime import datetime | ||
from enum import Enum | ||
|
||
from pipelines.schedules import create_daily_cron | ||
from pipelines.treatment.templates.utils import DBTSelector | ||
|
||
|
||
class constants(Enum): # pylint: disable=c0103 | ||
""" | ||
Valores constantes para materialização da validação dos dados da Jaé | ||
""" | ||
|
||
VALIDACAO_DADOS_JAE_SELECTOR = DBTSelector( | ||
name="validacao_dados_jae", | ||
schedule_cron=create_daily_cron(hour=7), | ||
initial_datetime=datetime(2024, 12, 30, 0, 0, 0), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Flows de tratamento dos dados da validação dos dados da Jaé | ||
""" | ||
|
||
from pipelines.constants import constants as smtr_constants | ||
from pipelines.migration.br_rj_riodejaneiro_bilhetagem.constants import ( | ||
constants as bilhetagem_constants, | ||
) | ||
from pipelines.schedules import create_daily_cron, create_hourly_cron | ||
from pipelines.treatment.templates.flows import create_default_materialization_flow | ||
from pipelines.treatment.validacao_dados_jae.constants import constants | ||
|
||
transacao_materializacao_params = ( | ||
bilhetagem_constants.BILHETAGEM_MATERIALIZACAO_TRANSACAO_PARAMS.value | ||
) | ||
|
||
integracao_materializacao_params = ( | ||
bilhetagem_constants.BILHETAGEM_MATERIALIZACAO_INTEGRACAO_PARAMS.value | ||
) | ||
|
||
VALIDACAO_DADOS_JAE_MATERIALIZACAO = create_default_materialization_flow( | ||
flow_name="validacao_dados_jae - materializacao", | ||
selector=constants.VALIDACAO_DADOS_JAE_SELECTOR.value, | ||
agent_label=smtr_constants.RJ_SMTR_AGENT_LABEL.value, | ||
wait=[ | ||
{ | ||
"redis_key": f"{integracao_materializacao_params['dataset_id']}\ | ||
.{integracao_materializacao_params['table_id']}", | ||
"dict_key": "last_run_timestamp", | ||
"datetime_format": "%Y-%m-%dT%H:%M:%S", | ||
"delay_hours": integracao_materializacao_params["dbt_vars"]["date_range"][ | ||
"delay_hours" | ||
], | ||
"schedule_cron": create_daily_cron(hour=5), | ||
}, | ||
{ | ||
"redis_key": f"{transacao_materializacao_params['dataset_id']}\ | ||
.{transacao_materializacao_params['table_id']}", | ||
"dict_key": "last_run_timestamp", | ||
"datetime_format": "%Y-%m-%dT%H:%M:%S", | ||
"delay_hours": transacao_materializacao_params["dbt_vars"]["date_range"]["delay_hours"], | ||
"schedule_cron": create_hourly_cron(), | ||
}, | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.