diff --git a/pipelines/datasets/br_anp_precos_combustiveis/flows.py b/pipelines/datasets/br_anp_precos_combustiveis/flows.py index f8cc27c9d..eaa5e4c96 100644 --- a/pipelines/datasets/br_anp_precos_combustiveis/flows.py +++ b/pipelines/datasets/br_anp_precos_combustiveis/flows.py @@ -11,15 +11,11 @@ from prefect.tasks.prefect import create_flow_run, wait_for_flow_run from pipelines.constants import constants -from pipelines.datasets.br_anp_precos_combustiveis.constants import ( - constants as anatel_constants, -) from pipelines.datasets.br_anp_precos_combustiveis.schedules import ( every_week_anp_microdados, ) from pipelines.datasets.br_anp_precos_combustiveis.tasks import ( check_for_updates, - data_max_bd_mais, data_max_bd_pro, download_and_transform, make_partitions, diff --git a/pipelines/datasets/br_anp_precos_combustiveis/tasks.py b/pipelines/datasets/br_anp_precos_combustiveis/tasks.py index 456731b94..46769d354 100644 --- a/pipelines/datasets/br_anp_precos_combustiveis/tasks.py +++ b/pipelines/datasets/br_anp_precos_combustiveis/tasks.py @@ -40,9 +40,8 @@ def check_for_updates(dataset_id, table_id): # Obtém a data mais recente do site download_files(anatel_constants.URLS_DATA.value, anatel_constants.PATH_INPUT.value) df = pd.read_csv(anatel_constants.URL_GLP.value, sep=";", encoding="utf-8") - data_obj = df["Data da Coleta"].max() - data_obj = datetime.strptime(data_obj, "%d/%m/%Y").strftime("%Y-%m-%d") - data_obj = datetime.strptime(data_obj, "%Y-%m-%d").date() + data_obj = pd.to_datetime(df["Data da Coleta"]).max() + data_obj = data_obj.date() # Obtém a última data no site BD data_bq_obj = extract_last_date(