Skip to content

Commit

Permalink
remoção do slice_data
Browse files Browse the repository at this point in the history
  • Loading branch information
patriciacatandi committed Oct 10, 2023
1 parent b7360b5 commit 129f9ac
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from pipelines.utils.constants import constants as utils_constants
from pipelines.rj_cor.meteorologia.meteorologia_redemet.tasks import (
get_dates,
# slice_data,
download,
tratar_dados,
salvar_dados,
Expand Down
21 changes: 1 addition & 20 deletions pipelines/rj_cor/meteorologia/meteorologia_redemet/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,6 @@ def get_dates(data_inicio: str, data_fim: str) -> Tuple[str, str]:
return data_inicio, data_fim, backfill


@task()
def slice_data(current_time: str) -> str:
"""
Retorna a data e hora do timestamp de execução
"""
if not isinstance(current_time, str):
current_time = current_time.to_datetime_string()

data = current_time[:10]
return data


@task(
max_retries=constants.TASK_MAX_RETRIES.value,
retry_delay=timedelta(seconds=constants.TASK_RETRY_DELAY.value),
Expand Down Expand Up @@ -110,14 +98,7 @@ def tratar_dados(dados: pd.DataFrame, backfill: bool = 0) -> pd.DataFrame:
Renomeia colunas e filtra dados com a hora do timestamp de execução
"""

drop_cols = [
"nome",
"cidade",
"lon",
"lat",
"localizacao",
"tempoImagem",
]
drop_cols = ["nome", "cidade", "lon", "lat", "localizacao", "tempoImagem", "metar"]
# Checa se todas estão no df
drop_cols = [c for c in drop_cols if c in dados.columns]

Expand Down

0 comments on commit 129f9ac

Please sign in to comment.