Repository navigation
fix: agencyAnalytics converte métricas Decimal em float (regressão do #28) - #29
Merged
Merged
Conversation
… (red) Com graphql-core 3.3 (instalado na imagem de produção, sem lock) o Float rejeita Decimal: 'Float cannot represent non numeric value: <Decimal instance>'. O AVG(CASE ... 1.0 ...) de pct_positive/pct_negative e o AVG(word_count) chegam do asyncpg como Decimal. Reproduzido com venv de dependências mais recentes (graphql-core 3.3.0, strawberry 0.331.6).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Regressão em produção introduzida pelo #28
agencyAnalytics { pctPositive }voltou a ter valor real, e com isso passou a falhar com:O
AVG(CASE ... THEN 1.0 ...)devolvenumeric, que o asyncpg entrega comoDecimal. A imagem de produção instala ographql-core3.3.0 (o repo não tem lock), e nessa versão oFloatrejeitaDecimal. O venv local tinha a 3.2.8, que aceita, por isso os testes não pegaram.O mesmo problema vai aparecer em
avgWordCount(AVG(word_count)) assim que o backfill de features preencherword_count, o que já está em andamento.Impacto: o gobus
health/pipelinespedepctPositive, e o cliente do gobus trata qualquer erro do GraphQL como falha. O portal não consulta esses campos.Correção
_as_float()no resolver deagencyAnalyticsparaavgSentimentScore,pctPositive,pctNegative,avgReadabilityFlescheavgWordCount.NonecontinuaNone.Testes
graphql-core/strawberry, para o CI testar o que vai para produção.