{"record":{"id":"2fcede2a4690f417","repo":"unslothai/unsloth","slug":"entry-repo-has-no-image-column-to-import","errorCode":null,"errorMessage":"'{entry['repo']}' has no image column to import.","messagePattern":"'(.+?)' has no image column to import\\.","errorType":"http","errorClass":"HTTPException","httpStatus":502,"severity":"error","filePath":"studio/backend/routes/training.py","lineNumber":4102,"sourceCode":"    \"\"\"Stream rows from datasets.load_dataset into ``dest`` as numbered images + optional\n    .txt sidecars. Returns the number of images written.\"\"\"\n    from datasets import load_dataset\n\n    kwargs = {\"split\": \"train\"}\n    if entry.get(\"no_checks\"):\n        kwargs[\"verification_mode\"] = \"no_checks\"\n    # Stream rather than prepare the whole split: the loop keeps at most `cap` rows while these\n    # curated repos run to tens of thousands. A repo that cannot stream falls back to prepared.\n    try:\n        ds = load_dataset(entry[\"repo\"], streaming = True, **kwargs)\n        features = ds.features\n    except Exception:  # noqa: BLE001 -- not streamable; the prepared load is the fallback\n        ds = load_dataset(entry[\"repo\"], **kwargs)\n        features = ds.features\n    # Streaming can hand back a dataset whose features are only known once a row is read, so resolve the columns from the first row then.\n    image_col = _detect_image_column(features) if features else None\n    if image_col is None and features:\n        raise HTTPException(\n            status_code = 502,\n            detail = f\"'{entry['repo']}' has no image column to import.\",\n        )\n    caption_col = _detect_caption_column(entry, list(features.keys())) if features else None\n    written = 0\n    for row in ds:\n        if written >= cap:\n            break\n        if image_col is None:\n            image_col = _detect_image_column_from_row(row)\n            if image_col is None:\n                raise HTTPException(\n                    status_code = 502,\n                    detail = f\"'{entry['repo']}' has no image column to import.\",\n                )\n            caption_col = _detect_caption_column(entry, list(row.keys()))\n        img = row[image_col]\n        if img is None:","sourceCodeStart":4084,"sourceCodeEnd":4120,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/routes/training.py#L4084-L4120","documentation":"HTTP 502 from the HF-dataset import path (_materialize_hf_dataset): the repo loaded (streaming or prepared), its features were known, but _detect_image_column(features) found no column that looks like an image. The upstream curated repo's schema changed (or never had) an image column, so there is nothing to import; the server reports it as an upstream (502) failure rather than a client error.","triggerScenarios":"Importing a curated example whose entry['repo'] on Hugging Face changed schema — image column renamed (e.g. 'img' -> 'image'), replaced with a URL string column, or dropped. Fails before any row is read because features already advertise the columns.","commonSituations":"Upstream HF dataset maintainers renaming columns; curated-list drift in this repo pointing at an old revision; split/config kwargs selecting a subset without the image column.","solutions":["Retry after the curated list is updated in Studio (pull latest / update the app) — the fix is on the server's curated entries, not your data.","Verify the repo schema manually: datasets.load_dataset_features(repo) and inspect column types, then report the drift.","Choose a different example dataset that still has an image column."],"exampleFix":"python -c \"from datasets import load_dataset_builder; \\\n  b = load_dataset_builder('username/repo'); print(b.info.features)\"","handlingStrategy":"fallback","validationCode":"from datasets import load_dataset_builder\n\ndef repo_has_image_column(repo: str) -> bool:\n    feats = load_dataset_builder(repo).info.features\n    return any(getattr(f, '_type', None) == 'Image' for f in (feats or {}).values())","typeGuard":"def is_no_image_column(exc: HTTPException) -> bool:\n    return exc.status_code == 502 and 'no image column' in str(exc.detail)","tryCatchPattern":"try:\n    await api.importExample(ex.id)\nexcept HTTPStatusError as e:\n    if e.response.status_code == 502 and 'no image column' in e.response.text:\n        pick_another_example()  # upstream schema drift; not retryable as-is\n    else:\n        raise","preventionTips":["Treat 'no image column' as upstream drift — do not blind-retry; pick another example or update the app.","Pin curated repos to known-good revisions when adding new examples.","Health-check curated schemas in CI (features assert image column exists)."],"tags":["huggingface","upstream","import","http-502"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}