{"record":{"id":"d94f275340a4531d","repo":"xai-org/x-algorithm","slug":"uknown-dataset-type-must-be-one-of-dataset-ty-d94f27","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_two_tower.py","lineNumber":247,"sourceCode":"            return PhoenixDataset(\n                hash_table=hash_table,\n                path=\"/path/to/offline_kafka_dump\",\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                hash_vocab_size=mparams[\"hash_vocab_size\"],\n                num_continuous_actions=mparams[\"num_continuous_actions\"],\n                num_negatives_per_example=mparams[\"num_negatives_per_example\"],\n                num_global_negatives_per_example=mparams[\"num_global_negatives_per_example\"],\n                num_kafka_partitions=1024,\n                include_candidate_post_ids=True,\n                date_range=mparams.get(\"date_range\", None),\n                global_ids_file_path=_global_ids_file_path,\n                use_post_sid=_use_post_sid,\n                sid_num_levels=_sid_num_levels,\n            )\n        case _:\n            raise ValueError(f\"Uknown {dataset_type=}, must be one of {DATASET_TYPES}\")\n\n\ndef _xrecsys_two_tower_combined_base() -> dict:\n    return {\n        \"history_seq_len\": 1023,\n        \"enable_user_country_feature\": True,\n        \"enable_user_language_feature\": True,\n        \"enable_user_location_feature\": True,\n        \"enable_user_gender_feature\": True,\n        \"enable_user_age_feature\": True,\n        \"enable_user_installed_apps\": True,\n        \"candidate_seq_len\": 64,\n        \"num_negatives_per_example\": 0,\n        \"num_global_negatives_per_example\": 64,\n        \"num_layers\": 8,\n        \"emb_size\": 1024,\n        \"emb_table_width\": 1024,\n        \"query_heads\": 16,","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/phoenix/xrex/configs/xrecsys_two_tower.py#L229-L265","documentation":"The two-tower model's _make_dataset match over dataset_type exhausted all cases without a hit, so the value is not a valid DATASET_TYPES member for this family. (Message contains the typo 'Uknown'.)","triggerScenarios":"Calling _make_dataset in xrecsys_two_tower with a dataset_type outside DATASET_TYPES and not present in RANKING_DATASET_FACTORIES — e.g. 'two_tower' (model name, not dataset type), wrong case, or a type only supported in another family.","commonSituations":"Confusing model name with dataset_type; copy-pasting dataset_type from gen-recs or SID-retrieval configs; version drift after dataset type renames; typos.","solutions":["Set dataset_type to an exact member of DATASET_TYPES for xrecsys_two_tower","Check for case-sensitive typos (must match exactly, e.g. 'aggregated_kafka')","Register a custom dataset via config_registry.RANKING_DATASET_FACTORIES if needed","Print the registry keys to see all accepted values at runtime"],"exampleFix":"# before\ncfg = {\"dataset_type\": \"TwoTowerKafka\"}\n\n# after\nfrom phoenix.xrex.configs.xrecsys_two_tower import DATASET_TYPES\ncfg = {\"dataset_type\": \"aggregated_kafka\"}  # exact valid member","handlingStrategy":"validation","validationCode":"from phoenix.xrex.configs import xrecsys_two_tower\n\ndef validate_dataset_type(dataset_type: str) -> None:\n    if dataset_type not in xrecsys_two_tower.DATASET_TYPES:\n        raise SystemExit(\n            f\"Invalid dataset_type {dataset_type!r} for two_tower; valid: {xrecsys_two_tower.DATASET_TYPES}\"\n        )","typeGuard":"def is_two_tower_dataset_type(dataset_type: str) -> bool:\n    return dataset_type in DATASET_TYPES","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; valid: {DATASET_TYPES}\") from e\n    raise","preventionTips":["Don't confuse model names with dataset_type values","Validate configs against DATASET_TYPES in a pre-launch check","Use typing.Literal / constants for dataset_type to catch typos early"],"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"}