A reference to a record of a spec the workspace does not run raises a bare KeyError

Offen Anfängerfreundlich
#175 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
74/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
backend

Rechercherichtung

Beginne in workspace.py bei Workspace._check_reads und verfolge, wie _source_spec und _bindings mit einem referenzierten Datensatz umgehen, dessen Spec nicht gebunden ist. Prüfe die Tests für Submit-Fehler und den Neustartpfad für ausstehende Datensätze. Fertig ist die Arbeit, wenn beim Einreichen ein SubmitError gemeldet wird, der den Parameter und die fehlende Spec nennt; beim Fehlschlagen des Neustarts erlaubt das Issue entweder denselben Grund oder die Weigerung, zu öffnen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

A request that references a record whose spec the workspace does not run is refused with a bare KeyError, not a SubmitError with a reason:

# workspace A runs DETECTOR and MASKS and persists a detector record.
# workspace B is opened on the same log and store, with MASKS only.
client_b.submit(MASKS, params={'detector': detector.ref('detector'), ...})
# KeyError: SpecId(name='loki-calibrated-detector', version=1)

The lookup is in Workspace._check_reads (workspace.py):

source = self._source_spec(ref, loc, also)
check_fit(self._bindings[source].spec, ref, tp, loc)

The same missing binding has a second effect: a workspace that restarts with pending records of a spec it does not run fails each of them with the reason KeyError: SpecId(...).

Expected: the submit is refused with a SubmitError that names the parameter and says the workspace does not run the spec of the referenced record. For the restart, either the same reason on the failed record, or a refusal to open.

Found while reviewing #174. essapps-batch requires --bind so that the usual way to reach this is closed, but any workspace opened with fewer bindings than its log has specs can reach it.

Vorherrschende Sprache
Python
Sterne
0
Forks
1
Ø Merge
8 Std. 48 Min.
Gemergte PRs (30 T.)
70

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus scipp/essapps

Alle Issues in scipp/essapps

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.