Skip to content

Commit

Permalink
[FEAT] SME educacao_basica_frequencia (#552)
Browse files Browse the repository at this point in the history
* feat: add educacao_basica_frequencia

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* feat: add educacao_basica_frequencia

* feat: add educacao_basica_frequencia

* feat: add educacao_basica_frequencia

* adicionando queries

* corrigindo erro de digitacao

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Karina Passos <[email protected]>
  • Loading branch information
4 people authored Nov 10, 2023
1 parent 1766d6f commit 9dc09bf
Showing 1 changed file with 224 additions and 0 deletions.
224 changes: 224 additions & 0 deletions pipelines/rj_sme/dump_db_educacao_basica/schedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,239 @@
"execute_query": "SELECT * FROM GestaoEscolar.dbo.VW_BI_Movimentacao_lgpd",
},
"turma": {
"dataset_id": "educacao_basica_frequencia",
"dump_mode": "overwrite",
"materialize_after_dump": True,
"materialize_to_datario": False,
"dump_to_gcs": False,
"materialization_mode": "prod",
"execute_query": "SELECT * FROM GestaoEscolar.dbo.VW_BI_Turma",
},
"turno": {
"dataset_id": "educacao_basica_frequencia",
"dump_mode": "overwrite",
"materialize_after_dump": False,
"materialize_to_datario": False,
"dump_to_gcs": False,
"materialization_mode": "prod",
"execute_query": """
SELECT
trn_id,
ent_id,
ttn_id,
trn_descricao,
trn_padrao,
trn_situacao,
trn_dataCriacao,
trn_dataAlteracao,
trn_controleTempo,
trn_horaInicio,
trn_horaFim
FROM GestaoEscolar.dbo.ACA_Turno
""",
},
"curriculo_periodo": {
"dataset_id": "educacao_basica_frequencia",
"dump_mode": "overwrite",
"materialize_after_dump": False,
"materialize_to_datario": False,
"dump_to_gcs": False,
"materialization_mode": "prod",
"execute_query": """
SELECT
cur_id,
crr_id,
crp_id,
mep_id,
crp_ordem,
crp_descricao,
crp_idadeIdealAnoInicio,
crp_idadeIdealMesInicio,
crp_idadeIdealAnoFim,
crp_idadeIdealMesFim,
crp_situacao,
crp_dataCriacao,
crp_dataAlteracao,
crp_controleTempo,
crp_qtdeDiasSemana,
crp_qtdeTemposSemana,
crp_qtdeHorasDia,
crp_qtdeMinutosDia,
crp_qtdeEletivasAlunos,
crp_ciclo,
crp_turmaAvaliacao,
crp_nomeAvaliacao,
crp_qtdeTemposDia,
crp_concluiNivelEnsino,
tci_id,
crp_fundoFrente,
tcp_id,
clg_id
FROM GestaoEscolar.dbo.ACA_CurriculoPeriodo
""",
},
"tipo_turno": {
"dataset_id": "educacao_basica_frequencia",
"dump_mode": "overwrite",
"materialize_after_dump": False,
"materialize_to_datario": False,
"dump_to_gcs": False,
"materialization_mode": "prod",
"execute_query": """
SELECT
ttn_id,
ttn_nome,
ttn_situacao,
ttn_dataCriacao,
ttn_dataAlteracao,
ttn_tipo,
ttn_classificacao
FROM GestaoEscolar.dbo.ACA_TipoTurno
""",
},
"turma_disciplina_rel": {
"dataset_id": "educacao_basica_frequencia",
"dump_mode": "overwrite",
"materialize_after_dump": False,
"materialize_to_datario": False,
"dump_to_gcs": False,
"materialization_mode": "prod",
"execute_query": """
SELECT
tur_id,
tud_id
FROM GestaoEscolar.dbo.TUR_TurmaRelTurmaDisciplina
""",
},
"turma_curriculo": {
"dataset_id": "educacao_basica_frequencia",
"dump_mode": "overwrite",
"materialize_after_dump": False,
"materialize_to_datario": False,
"dump_to_gcs": False,
"materialization_mode": "prod",
"execute_query": """
SELECT
tur_id,
cur_id,
crr_id,
crp_id,
tcr_prioridade,
tcr_situacao,
tcr_dataCriacao,
tcr_dataAlteracao
FROM GestaoEscolar.dbo.TUR_TurmaCurriculo
""",
},
"turma_aula": {
"dataset_id": "educacao_basica_frequencia",
"partition_columns": "tau_dataAlteracao",
"partition_date_format": "%Y-%m-%d",
"lower_bound_date": "current_month",
"dump_mode": "overwrite",
"materialize_after_dump": False,
"materialize_to_datario": False,
"dump_to_gcs": False,
"materialization_mode": "prod",
"execute_query": """
SELECT
tud_id,
tau_id,
tpc_id,
tau_sequencia,
tau_data,
tau_numeroAulas,
tau_planoAula,
tau_diarioClasse,
tau_situacao,
tau_dataCriacao,
tau_dataAlteracao,
tau_conteudo,
tau_efetivado,
tau_atividadeCasa,
tdt_posicao,
pro_id,
tau_sintese,
tau_reposicao,
usu_id,
usu_idDocenteAlteracao,
tau_statusFrequencia,
tau_statusAtividadeAvaliativa,
tau_statusAnotacoes,
tau_statusPlanoAula,
tau_recursosUtilizados
FROM GestaoEscolar.dbo.CLS_TurmaAula
""",
},
"turma_aula_aluno": {
"dataset_id": "educacao_basica_frequencia",
"partition_columns": "tau_dataAlteracao",
"partition_date_format": "%Y-%m-%d",
"lower_bound_date": "current_month",
"dump_mode": "overwrite",
"materialize_after_dump": False,
"materialize_to_datario": False,
"dump_to_gcs": False,
"materialization_mode": "prod",
"execute_query": """
SELECT
tud_id,
tau_id,
alu_id,
mtu_id,
mtd_id,
taa_frequencia,
taa_situacao,
taa_dataCriacao,
taa_dataAlteracao,
taa_anotacao,
taa_frequenciaBitMap,
usu_idDocenteAlteracao
FROM GestaoEscolar.dbo.CLS_TurmaAulaAluno
""",
},
"turma_disciplina": {
"dataset_id": "educacao_basica_frequencia",
"partition_columns": "tud_dataAlteracao",
"partition_date_format": "%Y-%m-%d",
"lower_bound_date": "current_month",
"dump_mode": "overwrite",
"materialize_after_dump": False,
"materialize_to_datario": False,
"dump_to_gcs": False,
"materialization_mode": "prod",
"execute_query": """
SELECT
tud_id,
tud_codigo,
tud_nome,
tud_multiseriado,
tud_vagas,
tud_minimoMatriculados,
tud_duracao,
tud_modo,
tud_tipo,
tud_dataInicio,
tud_dataFim,
tud_situacao,
tud_dataCriacao,
tud_dataAlteracao,
tud_cargaHorariaSemanal,
tud_aulaForaPeriodoNormal,
tud_global,
tud_disciplinaEspecial,
tud_naoLancarNota,
tud_naoLancarFrequencia,
tud_naoExibirNota,
tud_naoExibirFrequencia,
tud_semProfessor,
tud_naoExibirBoletim
FROM GestaoEscolar.dbo.TUR_TurmaDisciplina
""",
},
}


sme_clocks = generate_dump_db_schedules(
interval=timedelta(days=1),
start_date=datetime(2022, 1, 1, 2, 10, tzinfo=pytz.timezone("America/Sao_Paulo")),
Expand Down

0 comments on commit 9dc09bf

Please sign in to comment.