Fix c19 delimiter fallback in tail_threshold_v2 reader
Browse files138 unmodified lines139140141142143144145146147148149150138 unmodified lines
def _read_csv_rows(path: Path) -> tuple[list[str], list[dict[str, str]]]: delimiter = _sniff_delimiter(path) with path.open("r", encoding="utf-8-sig", newline="") as handle: first_line = handle.readline() # Some quoted comma CSVs with long text fields can be mis-sniffed as pipe. # If there are commas in the header line but no pipes, prefer comma parsing. if delimiter == "|" and "," in first_line and "|" not in first_line: delimiter = "," with path.open("r", encoding="utf-8-sig", newline="") as handle: reader = csv.DictReader(handle, delimiter=delimiter) rows = [dict(row) for row in reader]evaluation/tail/tail_threshold_code_v2/src/eval/tail_threshold_v2/runner.py+6