An Imported `_x` and a Computed `__x` in one schema share the jobs table `~~x`
Los mantenedores suelen responder en 5 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 18/100
Línea de trabajo
Start from the reproduction script: declare the Imported _result and Computed __result, then compare computed.jobs.full_table_name and imported.jobs.full_table_name. Read the jobs-table naming and refresh()/populate(reserve_jobs=True) paths, plus PR #1615 for the existing shared-table checks. Done means a chosen disambiguation policy, with tests proving the two job queues no longer mix records.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
The jobs table of a Computed or Imported table is named ~~ followed by the table name without its leading underscores. An Imported class Result (table _result) and a Computed class Result (table __result) can be declared in the same schema, and both map to the jobs table ~~result. A jobs table's rows hold the primary key and the job state, not the table they belong to, so the two tables share one job queue without any sign of it.
Effects
- Same primary key. Each table reads and changes the other's job records.
refresh()adds a pending job only for a key that has no job record, so a key with anerror,ignoreorreservedrecord from one table gets no job for the other, andpopulate(reserve_jobs=True)on the other table skips it. Either table'spopulate(reserve_jobs=True)also reserves pending jobs that the other table'srefresh()added. Each table'srefresh()judges every record against its ownkey_source, so it can remove the other table's records. - Different primary keys. The jobs table has the key of whichever table declared it first. With https://github.com/datajoint/datajoint-python/pull/1615, the other table's
jobsraises an error that names both tables; before it, the other table used a jobs table keyed on the wrong attributes. - Dropping one of the two. With https://github.com/datajoint/datajoint-python/pull/1615,
drop()keeps the shared jobs table, with a warning, while the other table exists, and drops it with the second table. Without that check, dropping either table would drop the other's job records too.
A Manual result also maps to ~~result, but a Manual table has no jobs table, so it does not conflict.
Reproduction
import datajoint as dj
schema = dj.Schema("scratch_jobs_names")
@schema
class Item(dj.Manual):
definition = """
item : int32
"""
@schema
class Result(dj.Computed):
definition = """
-> Item
---
value : int32
"""
def make(self, key):
raise RuntimeError("not ready")
computed = Result
@schema
class Result(dj.Imported):
definition = """
-> Item
---
value : int32
"""
def make(self, key):
self.insert1(dict(key, value=1))
imported = Result
Item.insert({"item": i} for i in range(3))
computed.populate(reserve_jobs=True, suppress_errors=True)
print(computed.jobs.full_table_name, imported.jobs.full_table_name) # the same table
imported.populate(reserve_jobs=True)
print(len(imported())) # 0: the Computed table's error records block every key
Options
- Name the jobs table after the full table name (
~~_resultand~~__result). Existing jobs tables would need to be renamed, or dropped and rebuilt byrefresh(), which loses theirerrorandignorerecords. - Refuse to declare a Computed
__xwhile an Imported_xexists in the same schema, and the reverse. - Record the owning table in each job record. This keeps one jobs table per name but changes the jobs table's primary key.
- Lenguaje dominante
- Python
- Estrellas
- 198
- Forks
- 107
- Merge medio
- 4 d 7 h
- PR fusionados (30 d)
- 12
Preparar el entorno
- Incluye un Dockerfile o un 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 datajoint/datajoint-python
-
bug triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
datajoint/datajoint-python#1775 ·
Los mantenedores suelen responder en 5 días
-
MySQL: with use_tls=False, 2.3.6 needs the cryptography package to log in to MySQL 8Posiblemente ocupada @dimitri-yatsenko la tomó hace 5 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
datajoint/datajoint-python#1750 ·
Los mantenedores suelen responder en 5 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
datajoint/datajoint-python#1747 ·
Los mantenedores suelen responder en 5 días
-
Reject constant defaults on primary-key attributesPosiblemente ocupada @godara-alt la tomó hace 4 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
datajoint/datajoint-python#1712 ·
Los mantenedores suelen responder en 5 días
-
Decoding a <blob> value in an unknown format returns None instead of raising an errorPosiblemente ocupada @godara-alt la tomó hace 9 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
datajoint/datajoint-python#1703 ·
Los mantenedores suelen responder en 5 días
Todos los issues de datajoint/datajoint-python
Issues similares
-
[Bug]: test_remote_realpath_uses_argument_vector fails on Windows with Python 3.13+ (ntpath.isabs)Posiblemente ocupada @gouyu-hou la tomó hoy. Abiertotriage/confirmed
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
agentscope-ai/agentscope#4397 ·
Los mantenedores suelen responder en 2 días
-
area/profiles area/sessions comp/desktop desktop/chat desktop/sessions P2 type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
NousResearch/hermes-agent#161712 ·
Los mantenedores suelen responder en 1 día
-
[New Check]: postgresql_flexible_server_public_network_access_disabledPosiblemente ocupada @pouria-l la tomó hoy. Abiertofeature-request status/needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
prowler-cloud/prowler#13615 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
SACGF/variantgrid#2941 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
linkedin/Liger-Kernel#1730 ·
Los mantenedores suelen responder en 3 días