Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Data] br_ms_sinan.microdados_dengue #906

Merged
merged 4 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading