Skip to content

Commit

Permalink
Merge pull request #907 from basedosdados/staging/fix-cgu
Browse files Browse the repository at this point in the history
[BugFix] br_cgu_cartao_pagamento
  • Loading branch information
tricktx authored Dec 12, 2024
2 parents 285f093 + cd68151 commit 48a974e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pipelines/utils/crawler_cgu/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


with Flow(
name="CGU - Cartão de Pagamento"
name="CGU - Cartão de Pagamento", code_owners=["trick"]
) as flow_cgu_cartao_pagamento:

dataset_id = Parameter("dataset_id", default='br_cgu_cartao_pagamento', required=True)
Expand Down Expand Up @@ -222,7 +222,7 @@

# ! ================================== CGU - Licitacao e Contrato =====================================

with Flow(name="CGU - Licitacão e Contrato") as flow_cgu_licitacao_contrato:
with Flow(name="CGU - Licitacão e Contrato", code_owners=["trick"]) as flow_cgu_licitacao_contrato:

dataset_id = Parameter(
"dataset_id", default="br_cgu_licitacao_contrato", required=True
Expand Down
2 changes: 2 additions & 0 deletions pipelines/utils/crawler_cgu/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ def get_current_date_and_download_file(table_id : str,
year = next_date_in_api.year,
month = next_date_in_api.month,
relative_month=relative_month))

log(f"Max date: {max_date}")

date = datetime.strptime(max_date, '%Y-%m-%d')

return date
Expand Down
2 changes: 1 addition & 1 deletion pipelines/utils/crawler_cgu/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def download_file(dataset_id: str, table_id: str, year: int, month: int, relativ
str: The last date in the API if the URL is not found.
"""

if dataset_id in ["br_cgu_cartao_pagamento" and "br_cgu_licitacao_contrato"]:
if dataset_id in ["br_cgu_cartao_pagamento", "br_cgu_licitacao_contrato"]:
if dataset_id == "br_cgu_cartao_pagamento":
value_constants = constants.TABELA.value[table_id] # ! CGU - Cartão de Pagamento
elif dataset_id == "br_cgu_licitacao_contrato":
Expand Down

0 comments on commit 48a974e

Please sign in to comment.