{"record":{"id":"18286f8e09327c63","repo":"huggingface/open-r1","slug":"either-dataset-name-or-dataset-mixture-must-be-18286f","errorCode":null,"errorMessage":"Either `dataset_name` or `dataset_mixture` must be provided","messagePattern":"Either `dataset_name` or `dataset_mixture` must be provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/open_r1/utils/data.py","lineNumber":65,"sourceCode":"            combined_dataset = concatenate_datasets(datasets_list)\n            combined_dataset = combined_dataset.shuffle(seed=seed)\n            logger.info(f\"Created dataset mixture with {len(combined_dataset)} examples\")\n\n            if args.dataset_mixture.test_split_size is not None:\n                combined_dataset = combined_dataset.train_test_split(\n                    test_size=args.dataset_mixture.test_split_size, seed=seed\n                )\n                logger.info(\n                    f\"Split dataset into train and test sets with test size: {args.dataset_mixture.test_split_size}\"\n                )\n                return combined_dataset\n            else:\n                return DatasetDict({\"train\": combined_dataset})\n        else:\n            raise ValueError(\"No datasets were loaded from the mixture configuration\")\n\n    else:\n        raise ValueError(\"Either `dataset_name` or `dataset_mixture` must be provided\")\n","sourceCodeStart":47,"sourceCodeEnd":66,"githubUrl":"https://github.com/huggingface/open-r1/blob/1416fa0cf21595d2083b399a2a0bbddd7f6e9563/src/open_r1/utils/data.py#L47-L66","documentation":"get_dataset raises ValueError('Either `dataset_name` or `dataset_mixture` must be provided') when neither args.dataset_name nor args.dataset_mixture is set. The function requires exactly one data source; with neither it cannot load anything. This is a config-validation error at the very start of data loading.","triggerScenarios":"Calling get_dataset(ScriptArguments(...)) with dataset_name=None and dataset_mixture=None — e.g. launching a training/eval script without --dataset_name and without a dataset_mixture config.","commonSituations":"Forgotten --dataset_name CLI flag, YAML config missing the dataset key, relying on a renamed argument after a version change, programmatically constructing ScriptArguments with defaults left unset.","solutions":["Pass --dataset_name <hub_id> (with optional --dataset_config) on the command line","Or configure dataset_mixture in the YAML/args with a non-empty datasets list","Print/inspect the resolved ScriptArguments before calling get_dataset","Check documentation for the current argument names after upgrading open-r1"],"exampleFix":"// before\nargs = ScriptArguments()\ndataset = get_dataset(args)\n// after\nargs = ScriptArguments(dataset_name=\"HuggingFaceH4/ultrachat_200k\")\ndataset = get_dataset(args)","handlingStrategy":"validation","validationCode":"def validate_data_source(args):\n    if not args.dataset_name and not args.dataset_mixture:\n        raise ValueError(\"Provide either --dataset_name or a dataset_mixture config before training\")","typeGuard":"def has_data_source(args):\n    return bool(args.dataset_name) or bool(args.dataset_mixture)","tryCatchPattern":null,"preventionTips":["Make --dataset_name (or mixture config) a required argument in your launcher scripts","Add an argparse-level check so the script fails fast with a clear message","Template configs with the dataset key always populated","Write a smoke test that constructs ScriptArguments from your real YAML and calls get_dataset"],"tags":["config","datasets","missing-argument"],"backgroundTag":"missing-required-config","analyzedSha":"1416fa0cf21595d2083b399a2a0bbddd7f6e9563","analyzedAt":"2026-08-30T08:56:53.400Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}