Skip to content

Fixed normalize responses#93

Merged
igr-santos merged 2 commits intomainfrom
hotfix/normalization-problem
Jan 13, 2025
Merged

Fixed normalize responses#93
igr-santos merged 2 commits intomainfrom
hotfix/normalization-problem

Conversation

@sergiomario
Copy link
Contributor

Contexto

Acontecia um erro na normalização porque a função str.replace() nativa do Python não aceita o argumento regex, pode ser devido alguma atualização da lib.
Captura de Tela 2025-01-08 às 17 09 28

Solução

Para corrigir, substitui para a função re.sub do módulo re, que suporta expressões regulares.

Principais mudanças:

  • Funções reutilizáveis: Centralizei normalizações comuns, como normalize_phone, normalize_name e normalize_region, para evitar duplicidade.
  • Validações: Adicionei validações mais explícitas para garantir consistência nos dados.
  • Clean response: Mantive o padrão para remoção de valores nulos ou vazios.

@sergiomario sergiomario added the bug Something isn't working label Jan 8, 2025
@sergiomario sergiomario self-assigned this Jan 8, 2025
@igr-santos igr-santos merged commit f1f7446 into main Jan 13, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants