{"record":{"id":"c62dc349498e53b0","repo":"tensorflow/models","slug":"feature-names-must-be-a-list-of-strings-but-got-t","errorCode":null,"errorMessage":"feature_names must be a list of strings, but got types {list(map(type, feature_names))}","messagePattern":"feature_names must be a list of strings, but got types (.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"official/recommendation/uplift/layers/encoders/concat_features.py","lineNumber":51,"sourceCode":"\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\n    }\n\n    most_specific_shape = tf.TensorShape(None)\n    for feature_name, shape in feature_shapes.items():\n      if not isinstance(shape, tf.TensorShape):","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/recommendation/uplift/layers/encoders/concat_features.py#L33-L69","documentation":"Error \"feature_names must be a list of strings, but got types {list(map(type, feature_names))}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/recommendation/uplift/layers/encoders/concat_features.py:51 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"}