{"record":{"id":"567d79847c2c0aa7","repo":"tursodatabase/turso","slug":"run-path-has-columns-run-columns-runs-0-path-has-columns","errorCode":null,"errorMessage":"{run.path} has columns {run.columns}, {runs[0].path} has {columns}","messagePattern":"(.+?) has columns (.+?), (.+?) has (.+?)","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"perf/tpc-h/plot/plot-tpch.py","lineNumber":69,"sourceCode":"\n\ndef main():\n    parser = argparse.ArgumentParser()\n    parser.add_argument(\"csv_files\", type=Path, nargs=\"+\")\n    parser.add_argument(\"--out\", type=Path, default=Path(\"tpch\"), metavar=\"PREFIX\",\n                        help=\"write PREFIX.png, PREFIX.pdf and PREFIX.tikz (default tpch)\")\n    parser.add_argument(\"--name\", action=\"append\", default=[], metavar=\"ENGINE=NAME\",\n                        help=\"legend name for an engine, e.g. limbo=Turso\")\n    args = parser.parse_args()\n    names = dict(name.split(\"=\", 1) for name in args.name)\n\n    runs = [read_run(path) for path in args.csv_files]\n    columns = runs[0].columns\n    if not runs[0].rows or not columns:\n        raise SystemExit(\"no results found\")\n    for run in runs[1:]:\n        if run.columns != columns:\n            raise SystemExit(f\"{run.path} has columns {run.columns}, {runs[0].path} has {columns}\")\n\n    figure = Figure(runs, columns, names)\n    for suffix in (\".png\", \".pdf\"):\n        output = args.out.with_suffix(suffix)\n        figure.matplotlib(output)\n        print(f\"wrote {output}\")\n    output = args.out.with_suffix(\".tikz\")\n    output.write_text(figure.tikz())\n    print(f\"wrote {output}\")\n\n\nclass Run:\n    \"\"\"One CSV: the queries in file order and every engine's time for each.\"\"\"\n\n    def __init__(self, path, columns, rows):\n        self.path = path\n        self.columns = columns\n        self.rows = rows","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/tursodatabase/turso/blob/492c4a71cd7c2649e7df83da1471b74f4b1c7aa9/perf/tpc-h/plot/plot-tpch.py#L51-L87","documentation":"All CSV files given to the plotter are plotted as series on the same axes, so every run must share an identical column set. When a later run's columns differ from the first run's, the script exits naming both files and their column lists.","triggerScenarios":"Running plot-tpch.py with multiple --csv-file/--name inputs produced by different benchmark versions, different scale factors, or a benchmark whose output columns changed between runs.","commonSituations":"Comparing results across git revisions after the benchmark's CSV schema changed; mixing old benchmark outputs with new ones; one CSV generated by a modified script with extra/renamed columns.","solutions":["Regenerate all CSVs with the same benchmark version so schemas match.","Inspect the column mismatch: `head -1 old.csv` vs `head -1 new.csv`, and drop or convert the incompatible file.","Plot only runs from the same schema generation in one invocation.","If a column rename is expected, update the plotting script's expectations and migrate old CSVs."],"exampleFix":"// before\npython plot-tpch.py --csv-files old_schema.csv new_schema.csv -o out\n// after\npython plot-tpch.py --csv-files new_schema_run1.csv new_schema_run2.csv -o out","handlingStrategy":"validation","validationCode":"import csv\ndef columns_of(path):\n    with open(path, newline=\"\") as f:\n        return next(csv.reader(f), [])\ndef schemas_match(paths):\n    cols = columns_of(paths[0])\n    return all(columns_of(p) == cols for p in paths[1:])","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only compare benchmark results generated by the same benchmark version","Keep CSV schema changes in sync with plotting scripts","Archive old-schema results separately from new ones"],"tags":["python","plotting","csv","schema-mismatch"],"backgroundTag":"schema-validation-failed","analyzedSha":"492c4a71cd7c2649e7df83da1471b74f4b1c7aa9","analyzedAt":"2026-09-13T18:13:59.796Z","contentChangedAt":"2026-09-13T18:13:59.796Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}