State.wipe() with no arguments raises TypeError instead of clearing state
Los mantenedores suelen responder en 3 días
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 79/100
Línea de trabajo
Empieza por burr/core/state.py, en State.wipe() alrededor de la línea 440, y lee cómo el método gestiona delete y keep. Reproduce el fallo indicado con el ejemplo del issue y, después, comprueba si hay pruebas que cubran wipe() sin argumentos. Se considera terminado cuando la llamada devuelve un estado vacío sin generar un TypeError.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
wipe() says that calling it with no arguments deletes the whole state. When both delete and keep are None, the code skips the delete branch and runs [key for key in self._state if key not in keep] with keep=None. Python's in operator raises TypeError on None, so the call fails before anything is deleted. I read this from the code only. I did not run it.
Where
To reproduce
from burr.core.state import State
state = State({"a": 1, "b": 2})
assert state.wipe().get_all() == {}
Expected
State({"a": 1, "b": 2}).wipe() returns an empty state.
Actual
Raises TypeError (argument of type 'NoneType' is not iterable), based on the code path above. Not run.
assert state.wipe().get_all() == {}
~~~~~~~~~~^^
File "/Users/alibb/.ali-hq/work/gh/apache__burr/burr/core/state.py", line 440, in wipe
fields_to_delete = [key for key in self._state if key not in keep]
^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not a container or iterable
Checked on cdea4eb.
- Lenguaje dominante
- Python
- Estrellas
- 2.6k
- Forks
- 218
- Merge medio
- 4 d 8 h
- PR fusionados (30 d)
- 35
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una 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 apache/burr
-
Redis and Postgres persister integration tests fail when re-run against the same databasesPosiblemente ocupada @YongGoose la tomó hoy. Abiertostatus/needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 3 días
-
Notebook UI launcher should use the current Python interpreterPosiblemente ocupada @sivakumar-mahalingam la tomó hace 21 días. Abiertostatus/needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 3 días
-
astep() passes unprocessed inputs to pre_run_step hooksPosiblemente ocupada @sivakumar-mahalingam la tomó hace 21 días. Abiertostatus/needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 3 días
-
`burr` fails to start when the Python path has a space in itPosiblemente ocupada @enekoreto la tomó hace 24 días. Abiertostatus/needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 3 días
-
area/storage area/ui help wanted kind/documentation priority/low
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
apache/burr#524 · 11 comentarios ·
Los mantenedores suelen responder en 3 días
Todos los issues de apache/burr
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 91/100
marimo-team/marimo#11768 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
btclib-org/btclib-node#2358 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 87/100
Los mantenedores suelen responder en 7 días
-
good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
MTSWebServices/RecTools#330 ·