Skip to content

Commit

Permalink
Merge pull request #906 from basedosdados/staging/fix-ms-sinan-dengue
Browse files Browse the repository at this point in the history
[Data] br_ms_sinan.microdados_dengue
  • Loading branch information
tricktx authored Dec 5, 2024
2 parents 61c0812 + fbdb013 commit 18df455
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pipelines/datasets/br_ms_sinan/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pipelines.datasets.br_ms_sinan.schedules import (
everyday_sinan_microdados
)

# Pipeline Sinan
br_ms_sinan__microdados_dengue = deepcopy(flow_sinan)
br_ms_sinan__microdados_dengue.name = "br_ms_sinan.microdados_dengue"
br_ms_sinan__microdados_dengue.code_owners = ["tricktx"]
Expand Down
9 changes: 4 additions & 5 deletions pipelines/datasets/br_ms_sinan/schedules.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# -*- coding: utf-8 -*-
"""
Schedules for br_ms_sinan
"""
from datetime import datetime
from prefect.schedules import Schedule, adjustments, filters
from prefect.schedules.clocks import CronClock
from pipelines.constants import constants

"""
Schedules for br_ms_sinan
"""
everyday_sinan_microdados = Schedule(
clocks=[
CronClock(
Expand All @@ -27,4 +26,4 @@
],
filters=[filters.is_weekday],
adjustments=[adjustments.next_weekday],
)
)
1 change: 0 additions & 1 deletion pipelines/utils/crawler_datasus/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@


with Flow(name="DATASUS-SINAN", code_owners=["trick"]) as flow_sinan:
# Parameters
dataset_id = Parameter("dataset_id", default ="br_ms_sinan", required=True)
table_id = Parameter("table_id", default="microdados_dengue", required=True)
update_metadata = Parameter("update_metadata", default=True, required=False)
Expand Down
2 changes: 0 additions & 2 deletions pipelines/utils/crawler_datasus/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
from pipelines.utils.metadata.utils import get_api_most_recent_date, get_url
from pipelines.utils.utils import log



@task(
max_retries=2,
retry_delay=timedelta(seconds=constants.TASK_RETRY_DELAY.value),
Expand Down
1 change: 1 addition & 0 deletions pipelines/utils/crawler_datasus/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def dbf_to_parquet(dbf: str, table_id: str, counter: int, chunk_size:int) -> st
counter_chunk += 1

if table_id == "microdados_dengue":
log(f'---- post processing {table_id=}')
df = pd.read_parquet(parquet_filepath)

df = post_process_microdados_dengue(df)
Expand Down

0 comments on commit 18df455

Please sign in to comment.