{"record":{"id":"8a1b0a970d28b4b8","repo":"tursodatabase/turso","slug":"unsupported-engine-mode-key","errorCode":null,"errorMessage":"unsupported engine/mode: {key}","messagePattern":"unsupported engine/mode: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"perf/fts/plot/plot-fts.py","lineNumber":108,"sourceCode":"def read_file(path, percentile, samples):\n    configuration = None\n    runs = {}\n    with path.open(newline=\"\") as stream:\n        reader = csv.DictReader(stream)\n        required = set(CONFIGURATION) | {\"engine\", \"mode\", \"run\", \"query\", \"queries\"}\n        if not required <= set(reader.fieldnames or []):\n            raise ValueError(f\"{path}: missing benchmark columns\")\n        for row in reader:\n            if row.get(\"profiled\", \"false\") != \"false\":\n                raise ValueError(\"profiled timings must not be used for benchmark comparisons\")\n            current = tuple(row[key] for key in CONFIGURATION)\n            if configuration is None:\n                configuration = current\n            if configuration != current:\n                raise ValueError(\"plot only one configuration at a time\")\n            key = (row[\"engine\"], row[\"mode\"])\n            if key not in SERIES:\n                raise ValueError(f\"unsupported engine/mode: {key}\")\n            series = samples.setdefault(key, {query: [] for query in QUERIES})\n            query = row[\"query\"]\n            seen = runs.setdefault(row[\"run\"], {}).setdefault(key, set())\n            if query not in QUERIES or query in seen:\n                raise ValueError(f\"{path}: unknown or duplicate query {query}\")\n            seen.add(query)\n            series[query].append(read_measurement(row, percentile))\n    if not runs:\n        raise ValueError(f\"{path}: no results found\")\n    return configuration, runs\n\n\ndef read_measurement(row, percentile):\n    queries = int(row[\"queries\"])\n    positive_number(queries)\n    if row[\"benchmark\"] != \"memory\":\n        seconds = positive_number(row[\"seconds\"])\n    if row[\"benchmark\"] == \"memory\":","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/tursodatabase/turso/blob/8d4a589f8d13ac184700d2a8f724f27e1995be3b/perf/fts/plot/plot-fts.py#L90-L126","documentation":"The CSV contains an (engine, mode) pair that has no plotting series defined, so no line can be drawn for it. This is a generic validation guard in read_file: the benchmark CSV's engine and mode columns hold values outside the fixed set of supported SERIES combinations, typically a typo or a newly added engine/mode not yet registered in the SERIES table.","triggerScenarios":"CSV contains an engine or mode value not in SERIES, e.g. a typo like engine='tursodb' or a newly added mode not yet registered in SERIES.","commonSituations":"Renamed engine in the harness but stale plot script; adding a new benchmark mode and forgetting to update SERIES; hand-edited CSV values.","solutions":["Fix the engine/mode spelling in the CSV to match a supported SERIES key","Add the new (engine, mode) pair to the SERIES dict in plot-fts.py","Re-run the benchmark with supported engine/mode settings"],"exampleFix":"// before (plot-fts.py)\nSERIES = {(\"turso\", \"rw\"): ...}\n// after\nSERIES = {(\"turso\", \"rw\"): ..., (\"turso\", \"ro\"): ...}","handlingStrategy":"validation","validationCode":"def validate_engine_mode(row):\n    if (row[\"engine\"], row[\"mode\"]) not in SERIES:\n        raise ValueError(f\"unsupported engine/mode: {(row['engine'], row['mode'])}\")","typeGuard":"def is_supported_series(row) -> bool:\n    return (row.get(\"engine\"), row.get(\"mode\")) in SERIES","tryCatchPattern":"try:\n    configuration, runs = read_runs(path, percentile)\nexcept ValueError as e:\n    print(f\"unsupported series: {e}; update SERIES or fix CSV\")","preventionTips":["Update SERIES in plot-fts.py whenever the harness gains an engine/mode","Use the exact engine/mode strings emitted by the benchmark harness","Lint CSV values against SERIES before plotting"],"tags":["python","benchmark","unsupported-value"],"backgroundTag":"invalid-enum-value","analyzedSha":"8d4a589f8d13ac184700d2a8f724f27e1995be3b","analyzedAt":"2026-09-20T13:18:14.658Z","contentChangedAt":"2026-09-20T13:18:14.658Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}