renamed: row -> entries

This commit is contained in:
2026-06-03 23:00:14 +02:00
parent 0c41198b4f
commit dd13da8893
+3 -3
View File
@@ -27,16 +27,16 @@ def clear_pgroup(beamline: Beamline, pgroup: PGroup):
@router.post("/pgroups/{pgroup}/runs/{run}")
def append_run(beamline: Beamline, pgroup: PGroup, run: int, row: dict[str, Any]):
def append_run(beamline: Beamline, pgroup: PGroup, run: int, entries: dict[str, Any]):
lib = adb.get(beamline)
run_exists = lib.has_index(pgroup, run)
if run_exists:
raise HTTPException(HTTPStatus.CONFLICT, f"run {run} exists already in {beamline}/{pgroup}")
timestamp = row.pop("timestamp", None)
timestamp = entries.pop("timestamp", None)
timestamp = datetime.fromisoformat(timestamp) if timestamp else datetime.now()
row = {"timestamp": timestamp, **row} # setdefault would not force timestamp to be the first column
row = {"timestamp": timestamp, **entries} # setdefault would not force timestamp to be the first column
df = pd.DataFrame(row, index=[run])
lib.append_data(pgroup, df)