Skip to content

Commit

Permalink
fix: create_table_and_upload_to_gcs input dir
Browse files Browse the repository at this point in the history
  • Loading branch information
folhesgabriel committed Jan 23, 2025
1 parent 237d5e5 commit b8fb73f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pipelines/datasets/br_rf_cafir/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from pipelines.datasets.br_rf_cafir.tasks import (
task_decide_files_to_download,
task_parse_api_metadata,
parse_data
task_download_files
)
from pipelines.utils.constants import constants as utils_constants
from pipelines.utils.decorators import Flow
Expand Down Expand Up @@ -74,7 +74,7 @@
with case(is_outdated, True):
log_task("Existem atualizações! A run será inciada")

file_path = parse_data(
file_path = task_download_files(
url=br_rf_cafir_constants.URL.value[0],
file_list=arquivos,
headers=br_rf_cafir_constants.HEADERS.value,
Expand Down
4 changes: 2 additions & 2 deletions pipelines/datasets/br_rf_cafir/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def task_decide_files_to_download(df: pd.DataFrame, data_especifica: datetime.da
max_retries=3,
retry_delay=timedelta(seconds=constants.TASK_RETRY_DELAY.value),
)
def parse_data(url: str, file_list: list[str], data_atualizacao:[datetime.date], headers: dict) -> str:
def task_download_files(url: str, file_list: list[str], data_atualizacao:[datetime.date], headers: dict) -> str:
"""Essa task faz o download dos arquivos do FTP, faz o parse dos dados e salva os arquivos em um diretório temporário.
Returns:
Expand Down Expand Up @@ -120,4 +120,4 @@ def parse_data(url: str, file_list: list[str], data_atualizacao:[datetime.date],
# remove o arquivo de input
os.remove(os.path.join(br_rf_cafir_constants.PATH.value[0], file))

return br_rf_cafir_constants.PATH.value[1] + f"/imoveis_rurais/data={date}/"
return br_rf_cafir_constants.PATH.value[1] + f"/imoveis_rurais"

0 comments on commit b8fb73f

Please sign in to comment.