xai-org/x-algorithm · error · ValueError
Uknown {dataset_type=}, must be one of {DATASET_TYPES}
Error message
Uknown {dataset_type=}, must be one of {DATASET_TYPES} What it means
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'.)
Source
Thrown at phoenix/xrex/configs/xrecsys_two_tower.py:247
return PhoenixDataset(
hash_table=hash_table,
path="/path/to/offline_kafka_dump",
history_seq_len=mparams["history_seq_len"],
candidate_seq_len=mparams["candidate_seq_len"],
input_vocab_size=mparams["input_vocab_size"],
hash_vocab_size=mparams["hash_vocab_size"],
num_continuous_actions=mparams["num_continuous_actions"],
num_negatives_per_example=mparams["num_negatives_per_example"],
num_global_negatives_per_example=mparams["num_global_negatives_per_example"],
num_kafka_partitions=1024,
include_candidate_post_ids=True,
date_range=mparams.get("date_range", None),
global_ids_file_path=_global_ids_file_path,
use_post_sid=_use_post_sid,
sid_num_levels=_sid_num_levels,
)
case _:
raise ValueError(f"Uknown {dataset_type=}, must be one of {DATASET_TYPES}")
def _xrecsys_two_tower_combined_base() -> dict:
return {
"history_seq_len": 1023,
"enable_user_country_feature": True,
"enable_user_language_feature": True,
"enable_user_location_feature": True,
"enable_user_gender_feature": True,
"enable_user_age_feature": True,
"enable_user_installed_apps": True,
"candidate_seq_len": 64,
"num_negatives_per_example": 0,
"num_global_negatives_per_example": 64,
"num_layers": 8,
"emb_size": 1024,
"emb_table_width": 1024,
"query_heads": 16,View on GitHub (pinned to 24c60942c5)
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
Example fix
# before
cfg = {"dataset_type": "TwoTowerKafka"}
# after
from phoenix.xrex.configs.xrecsys_two_tower import DATASET_TYPES
cfg = {"dataset_type": "aggregated_kafka"} # exact valid member Defensive patterns
Strategy: validation
Validate before calling
from phoenix.xrex.configs import xrecsys_two_tower
def validate_dataset_type(dataset_type: str) -> None:
if dataset_type not in xrecsys_two_tower.DATASET_TYPES:
raise SystemExit(
f"Invalid dataset_type {dataset_type!r} for two_tower; valid: {xrecsys_two_tower.DATASET_TYPES}"
) Type guard
def is_two_tower_dataset_type(dataset_type: str) -> bool:
return dataset_type in DATASET_TYPES Try / catch
try:
ds = _make_dataset(mparams, dataset_type, hash_table, config_name)
except ValueError as e:
if "dataset_type" in str(e):
raise SystemExit(f"Bad dataset_type; valid: {DATASET_TYPES}") from e
raise Prevention
- 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
When it happens
Trigger: 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.
Common situations: Confusing model name with dataset_type; copy-pasting dataset_type from gen-recs or SID-retrieval configs; version drift after dataset type renames; typos.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- Uknown {dataset_type=}, must be one of {DATASET_TYPES}
- Unknown {dataset_type=}, must be one of {DATASET_TYPES}
- Unknown {dataset_type=} for the SID retrieval family
- Config module {mod_name!r} has no key {ver!r}. Closest match
- Did not find any files matching {file_pattern}
AI-assisted analysis of xai-org/x-algorithm@24c60942c5 (2026-08-28).
Data as JSON: /api/errors/d94f275340a4531d.
Report an issue: GitHub.