bulk_update consumes object and field iterators before all updates run
Los mantenedores suelen responder en 2 días
@IlyaKhalafi ya está trabajando en esto.
Desde el 14/10/2026.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 25/100
Línea de trabajo
Start from bulk_update and the two failures in the report: an iterator of objects is consumed during primary-key validation, and an iterator of field names is consumed by the first batch. Reproduce both calls on SQLite in memory with iter(...) inputs, then compare against reusable lists. Done means both calls update every row. Two open pull requests, #2320 and #2321, already target this issue, so review them before starting.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
On current develop ac38923, bulk_update accepts Iterable arguments but consumes an iterator of objects during primary-key validation. Iterators of field names are also consumed by the first batch, so later batches are not updated.
objects = [await Tournament.create(name="old") for _ in range(2)]
for obj in objects:
obj.name = "new"
await Tournament.bulk_update(iter(objects), fields=["name"])
# CaseException with an empty CASE expression
await Tournament.bulk_update(objects, fields=iter(["name"]), batch_size=1)
# Returns 1 and only updates the first object
I expected both calls to update both rows, as they do with reusable lists. Reproduced with SQLite in memory on Ubuntu and Python 3.14.6.
This differs from #1335 and PR #2126, which concern foreign-key field conversion.
- Lenguaje dominante
- Python
- Estrellas
- 5.6k
- Forks
- 523
- Merge medio
- 3 d 23 h
- PR fusionados (30 d)
- 12
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 tortoise/tortoise-orm
-
pydantic_model_creator returns a cached class that ignores model_config, validators and modulePosiblemente ocupada @moneebullah25 la tomó hace 5 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
tortoise/tortoise-orm#2310 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
tortoise/tortoise-orm#668 ·
Los mantenedores suelen responder en 2 días
-
Previewing bulk update SQL causes duplicate execution and affected-row countsPosiblemente ocupada @Fire162 la tomó hace 1 día. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 18/100
tortoise/tortoise-orm#2319 ·
Los mantenedores suelen responder en 2 días
-
leaf_nodes(app_label)/root_nodes(app_label) count cross-app edges, so migrating to app.__latest__ can plan nothingPosiblemente ocupada @inchang-ing la tomó hace 6 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
tortoise/tortoise-orm#2305 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Circular migration dependencies make forwards_plan/backwards_plan hang instead of raisingPosiblemente ocupada @moneebullah25 la tomó hace 6 días. Abierto
Dificultad 3/5 Medio día Aptitud para principiantes 68/100
tortoise/tortoise-orm#2304 ·
Los mantenedores suelen responder en 2 días
Todos los issues de tortoise/tortoise-orm
Issues similares
-
Path subtraction removes repeated suffix characters instead of one suffixPosiblemente ocupada @Gwerdonatus la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
joke2k/django-environ#671 ·
-
good first issue help wanted windows
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
-
test_pgbouncer deploys the server under test from Charmhub instead of the local build (track/1.31)Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
canonical/temporal-k8s-operator#195 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
`burr` fails to start when the Python path has a space in itPosiblemente ocupada @enekoreto la tomó hoy. Abiertostatus/needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 5 días
-
device support request
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
zigpy/zha-device-handlers#5461 ·
Los mantenedores suelen responder en 4 días