{"record":{"id":"24a32fe3b240ee32","repo":"unslothai/unsloth","slug":"no-conversation-column-found-expected-one-of-con","errorCode":null,"errorMessage":"No conversation column found. Expected one of {CONVERSATION_COLUMNS}, got columns: {dataset.column_names}","messagePattern":"No conversation column found\\. Expected one of (.+?), got columns: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"studio/backend/utils/datasets/dataset_none_detect.py","lineNumber":251,"sourceCode":"# ---------------------------------------------------------------------------\n\n\ndef find_none_chatml(dataset: Dataset, col: str = None) -> dict:\n    \"\"\"\n    Scan chatml/sharegpt/gptoss dataset for turns with None/empty content.\n    Auto-detects the conversation column if col=None.\n\n    Returns a stats dict with a complete 'findings' list - one entry per bad\n    turn with row_index, turn_index, role, value_type, and raw_value.\n    \"\"\"\n    if col is None:\n        # Reuse _probe_conversation so the all_corrupt path is handled here too.\n        _cinfo = _probe_conversation(dataset)\n        if _cinfo is not None:\n            col = _cinfo[\"column\"]\n\n    if col is None or col not in dataset.column_names:\n        raise ValueError(\n            f\"No conversation column found. \"\n            f\"Expected one of {CONVERSATION_COLUMNS}, got columns: {dataset.column_names}\"\n        )\n\n    stats = {\n        \"total_rows\": len(dataset),\n        \"column\": col,\n        \"rows_with_none_turns\": 0,\n        \"total_none_turns\": 0,\n        \"none_by_role\": {},  # role -> count of None turns\n        \"none_by_type\": {},  # \"None\" | \"empty_string\" | \"whitespace_only\" -> count\n        \"rows_all_none\": 0,  # rows where every turn is bad\n        \"bad_row_indices\": [],  # every row index that has at least one bad turn\n        \"findings\": [],  # detailed per-turn list\n    }\n\n    for i, row in enumerate(dataset):\n        conversation = row[col]","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/utils/datasets/dataset_none_detect.py#L233-L269","documentation":"ValueError from find_none_chatml (the core None-turn scanner) when no conversation column could be determined: auto-probe (_probe_conversation over CONVERSATION_COLUMNS) found nothing, or the explicitly passed col is not among dataset.column_names. The scanner needs a column of conversation lists to walk turn-by-turn, so there is nothing to scan without one.","triggerScenarios":"Calling find_none_chatml(dataset) on a dataset whose columns lack any of CONVERSATION_COLUMNS (e.g. only 'instruction'/'output' Alpaca-style columns), or find_none_chatml(dataset, col='chat') when the column is actually named 'messages'.","commonSituations":"Running the None/blank-turn audit tool on the wrong format (Alpaca instead of chat), column renamed during a previous preprocessing step, schemas that embed conversations under a non-standard name like 'history' or 'dialog'.","solutions":["Pass the actual column name explicitly: find_none_chatml(dataset, col='history')","Rename the column to a recognized name: dataset.rename_column('history', 'conversations')","If the dataset is Alpaca-style (no conversation column), use the alpaca scanner / fmt='alpaca' instead of the chatml one"],"exampleFix":"# before\nstats = find_none_chatml(dataset)  # dataset has column 'history'\n\n# after\nstats = find_none_chatml(dataset, col='history')\n# or: dataset = dataset.rename_column('history', 'conversations')","handlingStrategy":"validation","validationCode":"from studio.backend.utils.datasets.dataset_none_detect import CONVERSATION_COLUMNS\n\ndef has_conversation_column(dataset) -> bool:\n    return any(c in dataset.column_names for c in CONVERSATION_COLUMNS)","typeGuard":"def find_chat_column(dataset) -> str | None:\n    cols = set(dataset.column_names)\n    for c in CONVERSATION_COLUMNS:\n        if c in cols:\n            return c\n    return None","tryCatchPattern":null,"preventionTips":["Check dataset.column_names against CONVERSATION_COLUMNS before scanning","Pass col= explicitly whenever the schema is non-standard instead of relying on probing","Alpaca-style data (instruction/output) has no conversation column — use the alpaca scanner"],"tags":["datasets","data-quality","chatml","validation"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}