Skip to content

Commit

Permalink
fix: plano verao criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-milan committed Nov 1, 2024
1 parent ad5afdf commit fc770d6
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion pipelines/mapa_realizacoes/infopref/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,21 @@ def transform_infopref_realizacao_to_firebase(
log(f"Could not find subprefeitura with id {id_subprefeitura}.", "warning")

# Plano verão stuff
plano_verao = entry["plano_verao"].lower() == "sim"

# Begin by checking if the `plano_verao` tag is enabled or it's from programa
# `bairro_maravilha`
plano_verao = entry["plano_verao"].lower() == "sim" or id_programa == "bairro_maravilha"

# Then, if 2024 or 2025 is in the `pv_ano_aplicacao` text, we consider it as a Plano Verão.
# Else, we disable the Plano Verão tag.
if plano_verao:
pv_ano_aplicacao = entry["pv_ano_aplicacao"] if "pv_ano_aplicacao" in entry else None
if not pv_ano_aplicacao:
plano_verao = False
elif not ("2024" in entry["pv_ano_aplicacao"] or "2025" in entry["pv_ano_aplicacao"]):
plano_verao = False

# If it's a Plano Verão, we get the Plano Verão fields
if plano_verao:
pv_ano_aplicacao = entry["pv_ano_aplicacao"] if "pv_ano_aplicacao" in entry else None
pv_tipo_iniciativa = (
Expand Down

0 comments on commit fc770d6

Please sign in to comment.