{"record":{"id":"bbad34e873bf7a88","repo":"tensorflow/models","slug":"feature-names-must-be-a-non-empty-list-of-strings","errorCode":null,"errorMessage":"feature_names must be a non-empty list of strings but got {feature_names} instead.","messagePattern":"feature_names must be a non-empty list of strings but got (.+?) instead\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/recommendation/uplift/layers/encoders/concat_features.py","lineNumber":46,"sourceCode":"  Takes a dictionary of feature tensors as input and concatenates the specified\n  features into a single tensor. The tensors are concatenated along their last\n  axis. Sparse and ragged tensors are converted to dense tensors before being\n  concatenated.\n  \"\"\"\n\n  def __init__(self, feature_names: Sequence[str], **kwargs):\n    \"\"\"Initializes a feature concatenation encoder.\n\n    Args:\n      feature_names: names of the input features to concatenate together.\n      **kwargs: base layer keyword arguments.\n    \"\"\"\n    super().__init__(**kwargs)\n    self._feature_names = feature_names\n\n    # Validate feature names.\n    if not feature_names:\n      raise ValueError(\n          \"feature_names must be a non-empty list of strings but got\"\n          f\" {feature_names} instead.\"\n      )\n    if not all(isinstance(name, str) for name in feature_names):\n      raise TypeError(\n          \"feature_names must be a list of strings, but got types\"\n          f\" {list(map(type, feature_names))}\"\n      )\n\n  def build(self, input_shapes: Mapping[str, tf.TensorShape]) -> None:\n    missing_features = set(self._feature_names) - input_shapes.keys()\n    if missing_features:\n      raise ValueError(f\"Layer inputs is missing features: {missing_features}\")\n\n    feature_shapes = {\n        feature_name: tensor_shape\n        for feature_name, tensor_shape in input_shapes.items()\n        if feature_name in self._feature_names","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/recommendation/uplift/layers/encoders/concat_features.py#L28-L64","documentation":"Error \"feature_names must be a non-empty list of strings but got {feature_names} instead.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/recommendation/uplift/layers/encoders/concat_features.py:46 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}