{"record":{"id":"036cee9eb6a66e0d","repo":"unslothai/unsloth","slug":"item-types-must-not-be-empty","errorCode":null,"errorMessage":"item_types must not be empty","messagePattern":"item_types must not be empty","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"studio/backend/plugins/data-designer-github-repo-seed/src/data_designer_github_repo_seed/config.py","lineNumber":57,"sourceCode":"\n    @field_validator(\"repos\")\n    @classmethod\n    def _validate_repos(cls, v: list[str]) -> list[str]:\n        out: list[str] = []\n        for r in v or []:\n            r = r.strip()\n            if not r:\n                continue\n            if r.count(\"/\") != 1 or not all(r.split(\"/\")):\n                raise ValueError(f\"Each repo must be `owner/name`; got {r!r}\")\n            out.append(r)\n        return out\n\n    @field_validator(\"item_types\")\n    @classmethod\n    def _validate_item_types(cls, v: list[str]) -> list[str]:\n        if not v:\n            raise ValueError(\"item_types must not be empty\")\n        return list(dict.fromkeys(v))\n\n    @model_validator(mode = \"after\")\n    def _ensure_repos(self) -> \"GitHubRepoSeedSource\":\n        if not self.repos:\n            raise ValueError(\"At least one repo is required\")\n        return self\n","sourceCodeStart":39,"sourceCodeEnd":65,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/plugins/data-designer-github-repo-seed/src/data_designer_github_repo_seed/config.py#L39-L65","documentation":"Field validator _validate_item_types on GitHubRepoSeedSource requiring a non-empty item_types list. After the emptiness check the values are de-duplicated preserving order. An empty list means the scraper has nothing to fetch (issues, PRs, comments...), so it is rejected at config validation time.","triggerScenarios":"Supplying item_types: [] (or omitting it entirely if no default exists) in the data-designer-github-repo-seed recipe config.","commonSituations":"A YAML recipe template with a commented-out item_types block that parses to empty; tooling that filters item_types down to nothing; forgetting the field when hand-writing the config.","solutions":["Set item_types to at least one supported type, e.g. ['issues'] or ['issues', 'pull_requests', 'comments'].","Check for accidental filtering/merging logic upstream that empties the list before validation.","If generating config from a template, ensure the item_types key is actually populated."],"exampleFix":"# before\nitem_types = []\n\n# after\nitem_types = [\"issues\", \"pull_requests\"]","handlingStrategy":"validation","validationCode":"def item_types_valid(item_types: list[str] | None) -> bool:\n    return bool(item_types)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Default item_types in your config template to a known-good value like ['issues'].","Fail fast in your config loader if a required list is empty after parsing."],"tags":["pydantic","github","config","validation"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}