Same ghapi version returns different results depending on fastcore version (JSON `null` → empty `AttrDict`)
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 42/100
Línea de trabajo
Comienza con la reproducción de GhApi del issue y compara la conversión de la respuesta con fastcore 1.8.16 y 1.11.2, centrándote en el procesamiento de fastcore.dict2obj indicado en el informe. Se considera completado cuando los valores null del JSON de GitHub siguen siendo de forma coherente Python None en todas las versiones compatibles de fastcore, con el comportamiento verificado mediante la llamada mostrada para listar repositorios.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
When using the same ghapi version, the return value of API calls changes depending on the fastcore dependency version.
Specifically, JSON null values from the GitHub REST API (e.g. repository description) are returned as:
Nonewithfastcore==1.8.16- empty
fastcore.basics.AttrDict({}) withfastcore==1.11.2
This breaks the semantic meaning of the API response and causes downstream issues (e.g. database storage, business logic).
Why this is a problem
- GitHub API explicitly defines
description: nullas “no value” - In Python, this should map to
None {}(empty mapping) has a different semantic meaning thanNone- The behavior changes without changing the ghapi version, only by upgrading a dependency
From a user’s perspective, this means:
The same ghapi version produces different API results depending on dependency resolution
This breaks API contract stability and reproducibility.
Environment
| Component | Version |
|---|---|
| ghapi | 1.0.8 |
| fastcore (local) | 1.8.16 |
| fastcore (sam) | 1.11.2 |
| Python | 3.10.19 |
Reproduction Code
from ghapi.core import GhApi
api = GhApi(token="*******", owner="ORG_NAME")
batch = api.repos.list_for_org("ORG_NAME", per_page=1, page=1)
r0 = batch[0]
print("item:", r0.get("description"), type(r0.get("description")))
print("attr:", r0.description, type(r0.description))
print("has key:", "description" in r0)
Actual Results
With fastcore==1.11.2
item: {} <class 'fastcore.basics.AttrDict'>
attr: {} <class 'fastcore.basics.AttrDict'>
has key: True
With fastcore==1.8.16
item: None <class 'NoneType'>
attr: None <class 'NoneType'>
has key: True
Expected Behavior
JSON null values from the GitHub API should consistently map to Python None, regardless of fastcore version.
At minimum, ghapi should:
- Preserve the semantic meaning of
null - Or pin / constrain fastcore versions to avoid silent behavior changes
Additional Notes
- The conversion appears to happen during
fastcore.dict2objprocessing - ghapi currently forwards this behavior directly to users
- This is not a database or SQLAlchemy issue — the value is already
{}immediately after the ghapi call
This behavior change is unexpected, breaking, and difficult to detect, especially in data ingestion pipelines.
I believe this is worth addressing either in ghapi itself or through tighter fastcore integration.
Thanks for your work on ghapi.
- Lenguaje dominante
- Python
- Estrellas
- 687
- Forks
- 69
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de AnswerDotAI/ghapi
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
AnswerDotAI/ghapi#158 ·
-
Small fix needed to enable GHESAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
AnswerDotAI/ghapi#120 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 58/100
AnswerDotAI/ghapi#208 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
AnswerDotAI/ghapi#186 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
AnswerDotAI/ghapi#185 · 1 comentario · 1 reacción ·
Todos los issues de AnswerDotAI/ghapi
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 3 días
-
Negation with "not" and "no" is ignored during sentiment analysisPosiblemente ocupada @vivek-3728 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
techcsispit/mess-mood#11 · 1 comentario ·
-
changelog investigate
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ramnes/notion-sdk-py#408 ·
-
good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
btclib-org/btclib-wallet#267 ·
Los mantenedores suelen responder en 1 día
-
good first issue tech-debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
knnmelprop/YAADO#111 ·