Skip to content

Commit

Permalink
Merge pull request #463 from basedosdados/staging/br_ms_cnes
Browse files Browse the repository at this point in the history
[fix] br_ms_cnes
  • Loading branch information
folhesgabriel authored Sep 18, 2023
2 parents b1e0ba4 + d89cc8a commit 617d462
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
28 changes: 14 additions & 14 deletions pipelines/datasets/br_ms_cnes/schedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
schedule_br_ms_cnes_estabelecimento = Schedule(
clocks=[
CronClock(
cron="0 0 * * *", # every day at midnight
cron="0 9 * * *", # every day at 9:00
start_date=datetime(2023, 9, 1, 0, 0),
labels=[
constants.BASEDOSDADOS_PROD_AGENT_LABEL.value,
Expand All @@ -31,11 +31,11 @@
adjustments=[adjustments.next_weekday],
)


# todo selecionar outro horário
schedule_br_ms_cnes_profissional = Schedule(
clocks=[
CronClock(
cron="0 0 * * *", # every day at midnight
cron="30 6 * * *", # every day at 18:30
start_date=datetime(2023, 9, 1, 0, 0),
labels=[
constants.BASEDOSDADOS_PROD_AGENT_LABEL.value,
Expand All @@ -58,7 +58,7 @@
schedule_br_ms_cnes_equipe = Schedule(
clocks=[
CronClock(
cron="0 0 * * *", # every day at midnight
cron="30 9 * * *", # every day 9:30
start_date=datetime(2023, 9, 1, 0, 0),
labels=[
constants.BASEDOSDADOS_PROD_AGENT_LABEL.value,
Expand All @@ -80,7 +80,7 @@
schedule_br_ms_cnes_leito = Schedule(
clocks=[
CronClock(
cron="0 0 * * *", # every day at midnight
cron="0 10 * * *", # every day at 10:00
start_date=datetime(2023, 9, 1, 0, 0),
labels=[
constants.BASEDOSDADOS_PROD_AGENT_LABEL.value,
Expand All @@ -102,7 +102,7 @@
schedule_br_ms_cnes_equipamento = Schedule(
clocks=[
CronClock(
cron="0 0 * * *", # every day at midnight
cron="30 10 * * *", # every day at 10:30
start_date=datetime(2023, 9, 1, 0, 0),
labels=[
constants.BASEDOSDADOS_PROD_AGENT_LABEL.value,
Expand All @@ -124,7 +124,7 @@
schedule_br_ms_cnes_estabelecimento_ensino = Schedule(
clocks=[
CronClock(
cron="0 0 * * *", # every day at midnight
cron="45 10 * * *", # every day at 10:45
start_date=datetime(2023, 9, 1, 0, 0),
labels=[
constants.BASEDOSDADOS_PROD_AGENT_LABEL.value,
Expand All @@ -146,7 +146,7 @@
schedule_br_ms_cnes_dados_complementares = Schedule(
clocks=[
CronClock(
cron="0 0 * * *", # every day at midnight
cron="0 11 * * *", # every day 11:00
start_date=datetime(2023, 9, 1, 0, 0),
labels=[
constants.BASEDOSDADOS_PROD_AGENT_LABEL.value,
Expand All @@ -168,7 +168,7 @@
schedule_br_ms_cnes_estabelecimento_filantropico = Schedule(
clocks=[
CronClock(
cron="0 0 * * *", # every day at midnight
cron="15 11 * * *", # every day at 11:15
start_date=datetime(2023, 9, 1, 0, 0),
labels=[
constants.BASEDOSDADOS_PROD_AGENT_LABEL.value,
Expand All @@ -189,7 +189,7 @@
schedule_br_ms_cnes_gestao_metas = Schedule(
clocks=[
CronClock(
cron="0 0 * * *", # every day at midnight
cron="30 11 * * *", # every day at 11:30
start_date=datetime(2023, 9, 1, 0, 0),
labels=[
constants.BASEDOSDADOS_PROD_AGENT_LABEL.value,
Expand All @@ -212,7 +212,7 @@
schedule_br_ms_cnes_habilitacao = Schedule(
clocks=[
CronClock(
cron="0 0 * * *", # every day at midnight
cron="45 11 * * *", # every day at 11:45
start_date=datetime(2023, 9, 1, 0, 0),
labels=[
constants.BASEDOSDADOS_PROD_AGENT_LABEL.value,
Expand All @@ -234,7 +234,7 @@
schedule_br_ms_cnes_incentivos = Schedule(
clocks=[
CronClock(
cron="0 0 * * *", # every day at midnight
cron="45 11 * * *", # every day at 11:45
start_date=datetime(2023, 9, 1, 0, 0),
labels=[
constants.BASEDOSDADOS_PROD_AGENT_LABEL.value,
Expand All @@ -256,7 +256,7 @@
schedule_br_ms_cnes_regra_contratual = Schedule(
clocks=[
CronClock(
cron="0 0 * * *", # every day at midnight
cron="0 12 * * *", # every day at 12:00
start_date=datetime(2023, 9, 1, 0, 0),
labels=[
constants.BASEDOSDADOS_PROD_AGENT_LABEL.value,
Expand All @@ -279,7 +279,7 @@
schedule_br_ms_cnes_servico_especializado = Schedule(
clocks=[
CronClock(
cron="0 0 * * *", # every day at midnight
cron="30 12 * * *", # every day at 12:30
start_date=datetime(2023, 9, 1, 0, 0),
labels=[
constants.BASEDOSDADOS_PROD_AGENT_LABEL.value,
Expand Down
5 changes: 3 additions & 2 deletions pipelines/utils/metadata/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ def update_django_metadata(
"weeks": "weeks",
"days": "days",
}
if not isinstance(_last_date, str):
raise ValueError("O parâmetro `last_date` deve ser do tipo string")

if not isinstance(_last_date, str) and _last_date is not None:
raise ValueError("O parâmetro `last_date` deve ser uma string não nula")

if time_unit not in unidades_permitidas:
raise ValueError(
Expand Down

0 comments on commit 617d462

Please sign in to comment.