{"record":{"id":"1726a2a4d8443cce","repo":"tursodatabase/turso","slug":"no-results-found","errorCode":null,"errorMessage":"no results found","messagePattern":"no results found","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"perf/tpc-h/plot/plot-tpch.py","lineNumber":66,"sourceCode":"# column of engine names at its left is, in cm.\nTABLE_ROW_HEIGHT = 0.36\nTABLE_LABEL_WIDTH = 0.95\n\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):","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/tursodatabase/turso/blob/492c4a71cd7c2649e7df83da1471b74f4b1c7aa9/perf/tpc-h/plot/plot-tpch.py#L48-L84","documentation":"Generic input validation in the TPC-H plotting script's main(): after parsing the benchmark result CSV files, no rows matched the expected result set (e.g. the CSVs are empty, malformed, or contain different engine/query labels than the plot expects), so there is nothing to plot and the script aborts. It fires whenever the supplied CSV files yield zero usable result entries.","triggerScenarios":"Running plot-tpch.py with CSV files that are empty, header-only, or that failed to parse into rows/columns (read_run produced an empty run).","commonSituations":"Benchmark run crashed or was interrupted before any query completed, so results.csv contains only a header or is empty; wrong CSV path passed on the command line; results directory from a fresh/failed run.","solutions":["Check the CSV file actually contains a header row plus data rows: `wc -l results.csv` and `head results.csv`.","Re-run the TPC-H benchmark to produce fresh results before plotting.","Verify the --csv-files arguments point at completed benchmark outputs, not placeholder files.","If partial results are expected, ensure at least the first CSV has rows (the first file drives column validation)."],"exampleFix":"// before\npython plot-tpch.py --csv-files empty_run.csv -o out\n// after\npython plot-tpch.py --csv-files results/full_run.csv -o out","handlingStrategy":"validation","validationCode":"import csv\ndef csv_has_rows(path) -> bool:\n    with open(path, newline=\"\") as f:\n        r = csv.reader(f)\n        header = next(r, None)\n        return bool(header) and next(r, None) is not None","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Confirm the benchmark run completed before plotting its CSV","Check `wc -l` and `head` on result files passed to plotting scripts","Fail fast in the benchmark runner when zero queries complete"],"tags":["python","plotting","benchmark","empty-input"],"backgroundTag":"empty-result-set","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"}