From 7147b8dc1c082e7a60c6be7ab66808295c267211 Mon Sep 17 00:00:00 2001 From: tricktx Date: Fri, 29 Nov 2024 12:07:59 -0300 Subject: [PATCH] add from_file in load_municipio --- pipelines/utils/crawler_cgu/utils.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pipelines/utils/crawler_cgu/utils.py b/pipelines/utils/crawler_cgu/utils.py index 4360245c4..e1c418c3f 100644 --- a/pipelines/utils/crawler_cgu/utils.py +++ b/pipelines/utils/crawler_cgu/utils.py @@ -185,8 +185,11 @@ def download_file(dataset_id: str, table_id: str, year: int, month: int, relativ # Função para carregar o dataframe @lru_cache(maxsize=1) # Cache para evitar recarregar a tabela def load_municipio() -> None: - municipio : pd.DataFrame = bd.read_table( - "br_bd_diretorios_brasil", "municipio", billing_project_id="basedosdados-dev" + municipio: pd.DataFrame = bd.read_table( + "br_bd_diretorios_brasil", + "municipio", + billing_project_id="basedosdados-dev", + from_file=True, ) municipio["cidade_uf"] = ( municipio["nome"].apply(lambda x: x.upper()) + "-" + municipio["sigla_uf"] @@ -194,7 +197,6 @@ def load_municipio() -> None: return municipio - def get_similar_cities_process(city): municipio = load_municipio() results = process.extractOne(city, municipio["cidade_uf"], score_cutoff=70)