{"record":{"id":"4155b55bd27de524","repo":"FoundationAgents/MetaGPT","slug":"dataset-dataset-name-not-found-in-config-file-a","errorCode":null,"errorMessage":"Dataset {dataset_name} not found in config file. Available datasets: {config['datasets'].keys()}","messagePattern":"Dataset (.+?) not found in config file\\. Available datasets: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"metagpt/ext/sela/data/dataset.py","lineNumber":128,"sourceCode":"\n\ndef get_split_dataset_path(dataset_name, config):\n    datasets_dir = config[\"datasets_dir\"]\n    if dataset_name in config[\"datasets\"]:\n        dataset = config[\"datasets\"][dataset_name]\n        data_path = os.path.join(datasets_dir, dataset[\"dataset\"])\n        split_datasets = {\n            \"train\": os.path.join(data_path, \"split_train.csv\"),\n            \"dev\": os.path.join(data_path, \"split_dev.csv\"),\n            \"dev_wo_target\": os.path.join(data_path, \"split_dev_wo_target.csv\"),\n            \"dev_target\": os.path.join(data_path, \"split_dev_target.csv\"),\n            \"test\": os.path.join(data_path, \"split_test.csv\"),\n            \"test_wo_target\": os.path.join(data_path, \"split_test_wo_target.csv\"),\n            \"test_target\": os.path.join(data_path, \"split_test_target.csv\"),\n        }\n        return split_datasets\n    else:\n        raise ValueError(\n            f\"Dataset {dataset_name} not found in config file. Available datasets: {config['datasets'].keys()}\"\n        )\n\n\ndef get_user_requirement(task_name, config):\n    # datasets_dir = config[\"datasets_dir\"]\n    if task_name in config[\"datasets\"]:\n        dataset = config[\"datasets\"][task_name]\n        # data_path = os.path.join(datasets_dir, dataset[\"dataset\"])\n        user_requirement = dataset[\"user_requirement\"]\n        return user_requirement\n    else:\n        raise ValueError(\n            f\"Dataset {task_name} not found in config file. Available datasets: {config['datasets'].keys()}\"\n        )\n\n\ndef save_datasets_dict_to_yaml(datasets_dict, name=\"datasets.yaml\"):","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/FoundationAgents/MetaGPT/blob/11cdf466d042aece04fc6cfd13b28e1a70341b1f/metagpt/ext/sela/data/dataset.py#L110-L146","documentation":"Raised by the SELA dataset loader when the requested dataset_name is not a key in the loaded config's 'datasets' mapping (the datasets.yaml registry). The message lists the datasets that ARE available so the mismatch is visible.","triggerScenarios":"Calling the split-dataset helper with a task/dataset name that is not registered, e.g. get_split_datasets('abalone', config) or a custom OpenML dataset that was never added to datasets.yaml.","commonSituations":"Typos in --task; using a task name from a different fork/branch of datasets.yaml; forgetting to register a newly added dataset in config/datasets.yaml.","solutions":["Use one of the dataset names printed in the error message (they are the available keys)","Register your dataset in the datasets config yaml with its 'dataset', 'target_col' and 'user_requirement' entries","Check for typos/case differences in the task name passed on the CLI"],"exampleFix":"# before (task not registered)\ndatasets = get_split_datasets(\"abaline\", config)\n\n# after\ndatasets = get_split_datasets(\"abalone\", config)","handlingStrategy":"validation","validationCode":"if dataset_name not in config[\"datasets\"]:\n    raise KeyError(f\"unknown dataset {dataset_name}; known: {sorted(config['datasets'])}\")","typeGuard":"def is_registered_dataset(name: str, config: dict) -> bool:\n    return name in config.get(\"datasets\", {})","tryCatchPattern":null,"preventionTips":["Derive task names programmatically from config['datasets'].keys() instead of typing them","Register new datasets in datasets.yaml before referencing them"],"tags":["sela","config","dataset","validation"],"backgroundTag":null,"analyzedSha":"11cdf466d042aece04fc6cfd13b28e1a70341b1f","analyzedAt":"2026-08-14T23:20:02.994Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}