{"record":{"id":"6b171305594182eb","repo":"xai-org/x-algorithm","slug":"uknown-dataset-type-must-be-one-of-dataset-ty","errorCode":null,"errorMessage":"Uknown {dataset_type=}, must be one of {DATASET_TYPES}","messagePattern":"Uknown (.+?), must be one of (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"phoenix/xrex/configs/xrecsys.py","lineNumber":232,"sourceCode":"                sid_num_levels=_sid_num_levels,\n                enable_stale_post=_enable_stale_post,\n            )\n        case \"toy_dataset\":\n            return PhoenixToyDataset(\n                hash_table=hash_table,\n                path=None,\n                history_seq_len=mparams[\"history_seq_len\"],\n                candidate_seq_len=mparams[\"candidate_seq_len\"],\n                input_vocab_size=mparams[\"input_vocab_size\"],\n                num_continuous_actions=mparams[\"num_continuous_actions\"],\n                num_negatives_per_example=mparams.get(\"num_negatives_per_example\", 1),\n                multimodal_embedding_type=mparams.get(\"multimodal_embedding_type\"),\n                use_post_sid=_use_post_sid,\n                sid_num_levels=_sid_num_levels,\n                enable_stale_post=_enable_stale_post,\n            )\n        case _:\n            raise ValueError(f\"Uknown {dataset_type=}, must be one of {DATASET_TYPES}\")\n\n\ndef _sequence_len(mparams, dataset, num_user_prefix_tokens: int) -> int:\n    return (\n        num_user_prefix_tokens\n        + mparams[\"history_seq_len\"]\n        + dataset.candidate_seq_len * (1 + getattr(dataset, \"num_negatives_per_example\", 0))\n        + getattr(dataset, \"num_global_negatives_per_example\", 0)\n    )\n\n\ndef _home_direct_packed_base() -> dict:\n    return {\n        \"history_seq_len\": 1022,\n        \"candidate_seq_len\": 64,\n        \"num_layers\": 8,\n        \"emb_size\": 2560,\n        \"emb_table_width\": 1024,","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/phoenix/xrex/configs/xrecsys.py#L214-L250","documentation":"_make_dataset dispatches on dataset_type via a match statement (plus a RANKING_DATASET_FACTORIES registry lookup first). If dataset_type matches no case and no registered factory, it raises with the list of valid DATASET_TYPES. (Message contains the typo 'Uknown'.)","triggerScenarios":"Calling _make_dataset with a dataset_type not in DATASET_TYPES and not registered in config_registry.RANKING_DATASET_FACTORIES — e.g. 'Aggregated_Kafka' (wrong case), 'kafka' (shorthand), or a new unregistered type.","commonSituations":"Typos or case mismatch in the config's dataset_type; using a dataset type introduced in a newer version while running older code; renaming a dataset type and missing a call site; custom dataset registered under a different registry key.","solutions":["Set dataset_type to an exact member of DATASET_TYPES (case-sensitive), e.g. 'aggregated_kafka' or 'toy_dataset'","If you need a custom type, register it via config_registry.RANKING_DATASET_FACTORIES before building","Upgrade the package if the type exists in a newer release","Print DATASET_TYPES / RANKING_DATASET_FACTORIES keys to see what is actually available"],"exampleFix":"# before\ncfg = {..., \"dataset_type\": \"Aggregated_Kafka\"}\n\n# after\nfrom phoenix.xrex.configs.xrecsys import DATASET_TYPES\ncfg = {..., \"dataset_type\": \"aggregated_kafka\"}  # exact member","handlingStrategy":"validation","validationCode":"from phoenix.xrex.configs import xrecsys\nfrom phoenix.xrex.configs import config_registry\n\ndef validate_dataset_type(dataset_type: str) -> None:\n    if dataset_type not in xrecsys.DATASET_TYPES and dataset_type not in config_registry.RANKING_DATASET_FACTORIES:\n        raise SystemExit(\n            f\"Invalid dataset_type {dataset_type!r}; valid: {xrecsys.DATASET_TYPES}\"\n        )","typeGuard":"def is_valid_dataset_type(dataset_type: str) -> bool:\n    return dataset_type in DATASET_TYPES or dataset_type in config_registry.RANKING_DATASET_FACTORIES","tryCatchPattern":"try:\n    ds = _make_dataset(mparams, dataset_type, hash_table, config_name)\nexcept ValueError as e:\n    if \"dataset_type\" in str(e):\n        raise SystemExit(f\"Bad dataset_type; pick from {DATASET_TYPES}\") from e\n    raise","preventionTips":["Literal-type dataset_type values (typing.Literal) so IDEs/mypy catch typos","Centralize dataset_type strings as constants instead of raw strings in configs","Validate config dicts against a schema before launching long training jobs"],"tags":["config","dataset","dispatch","typo","python"],"backgroundTag":"invalid-config-value","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}