{"record":{"id":"a421018f6d09619b","repo":"tursodatabase/turso","slug":"no-sweep-results-found","errorCode":null,"errorMessage":"no sweep results found","messagePattern":"no sweep results found","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"perf/fts/plot/plot-fts.py","lineNumber":64,"sourceCode":"            plot(configuration, samples, output)\n        print(f\"wrote {output}\")\n\n\ndef read_sweep(paths, percentile=\"p50\"):\n    configuration = None\n    points = {}\n    for path in paths:\n        current, samples = read_runs([path], percentile)\n        connections = int(current.pop(\"connections\"))\n        if connections <= 0 or connections in points:\n            raise ValueError(\"each sweep file must have a distinct positive connection count\")\n        if configuration is None:\n            configuration = current\n        if current != configuration or (points and set(samples) != set(next(iter(points.values())))):\n            raise ValueError(\"sweep files must match benchmark, sample budget, fixture and engine/mode series\")\n        points[connections] = samples\n    if not points:\n        raise ValueError(\"no sweep results found\")\n    return configuration, dict(sorted(points.items()))\n\n\ndef read_runs(paths, percentile=\"p50\"):\n    configuration = None\n    samples = {}\n    expected_series = None\n    for path in paths:\n        current, runs = read_file(path, percentile, samples)\n        if configuration is None:\n            configuration = current\n        if configuration != current:\n            raise ValueError(\"plot only one configuration at a time\")\n        for run in runs.values():\n            if expected_series is None:\n                expected_series = set(run)\n            if set(run) != expected_series or any(seen != set(QUERIES) for seen in run.values()):\n                raise ValueError(f\"{path}: each run must contain the same series and all six query cases\")","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/tursodatabase/turso/blob/8d4a589f8d13ac184700d2a8f724f27e1995be3b/perf/fts/plot/plot-fts.py#L46-L82","documentation":"read_sweep raises this ValueError when the provided path list is empty or yielded no parseable sweep points, meaning there is nothing to plot. It is the guard against silently producing an empty connection-sweep chart.","triggerScenarios":"Calling read_sweep (via main) with an empty list of sweep CSV paths, or paths whose read_runs calls raised/excluded all points such that `points` stays empty.","commonSituations":"Running plot-fts.py against an empty results directory or a glob that matched nothing; all candidate files were rejected earlier in the pipeline.","solutions":["Pass at least one valid sweep result CSV to plot-fts.py.","Check the results directory/glob actually contains sweep files.","Generate sweep results by running the FTS benchmark before plotting."],"exampleFix":"# before\npython plot-fts.py results/empty-dir/*.csv\n# after\npython plot-fts.py results/c1.csv results/c8.csv","handlingStrategy":"validation","validationCode":"import glob\npaths = sorted(glob.glob('results/sweep-*.csv'))\nassert paths, 'no sweep result files found; run the benchmark first'","typeGuard":null,"tryCatchPattern":"try:\n    config, points = read_sweep(paths)\nexcept ValueError as e:\n    if 'no sweep results found' in str(e):\n        print('Fix: point plot-fts.py at existing sweep CSV files')\n    else:\n        raise","preventionTips":["Check the results directory is non-empty before invoking plot-fts.py.","Avoid globs that can silently match nothing; list files explicitly in scripts.","Run the sweep benchmark before attempting to plot."],"tags":["python","benchmarking","empty-input"],"backgroundTag":"empty-result-set","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"}