{"record":{"id":"f352cff6f1d20b7b","repo":"apache/beam","slug":"at-least-one-input-column-must-be-specified","errorCode":null,"errorMessage":"at least one input column must be specified","messagePattern":"at least one input column must be specified","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/ml/transforms/embeddings/vertex_ai.py","lineNumber":495,"sourceCode":"      dimension: The length of the embedding vector to generate. Must be one of\n        128, 256, 512, or 1408. If not set, Vertex AI's default value is 1408.\n        If submitting video content, dimension *musst* be 1408.\n      project: The default GCP project for API calls.\n      location: The default location for API calls.\n      credentials: Custom credentials for API calls.\n        Defaults to environment credentials.\n    \"\"\"\n    self.model_name = model_name\n    self.project = project\n    self.location = location\n    self.credentials = credentials\n    self.kwargs = kwargs\n    if dimension is not None and dimension not in (128, 256, 512, 1408):\n      raise ValueError(\n          \"dimension argument must be one of 128, 256, 512, or 1408\")\n    self.dimension = dimension\n    if not image_column and not video_column and not text_column:\n      raise ValueError(\"at least one input column must be specified\")\n    if video_column is not None and dimension != 1408:\n      raise ValueError(\n          \"Vertex AI does not support custom dimensions for video input, want dimension = 1408, got \",\n          dimension)\n    self.type_adapter = _create_multimodal_dict_adapter(\n        image_column=image_column,\n        video_column=video_column,\n        text_column=text_column)\n    super().__init__(type_adapter=self.type_adapter, **kwargs)\n\n  def get_model_handler(self) -> ModelHandler:\n    return _VertexAIMultiModalEmbeddingHandler(\n        model_name=self.model_name,\n        dimension=self.dimension,\n        project=self.project,\n        location=self.location,\n        credentials=self.credentials,\n        **self.kwargs)","sourceCodeStart":477,"sourceCodeEnd":513,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/ml/transforms/embeddings/vertex_ai.py#L477-L513","documentation":"The Vertex AI multimodal embeddings handler requires at least one of image_column, video_column, or text_column to be specified, since it must know which input fields to embed. Supplying none raises ValueError in __init__.","triggerScenarios":"Constructing the multimodal handler with image_column=None, video_column=None, and text_column=None (or omitted).","commonSituations":"Migrating from the image-only or text-only handler and forgetting that the multimodal one requires explicit column names; passing columns= only and assuming it maps to inputs.","solutions":["Pass at least one of image_column='img', video_column='vid', or text_column='txt' to the constructor.","If you only embed text, use the text-only handler instead.","Ensure the column names match your PCollection schema field names."],"exampleFix":"// before\nhandler = VertexAIMultimodalEmbeddings(columns=['data'])\n// after\nhandler = VertexAIMultimodalEmbeddings(columns=['data'], image_column='image', text_column='caption')","handlingStrategy":"validation","validationCode":"if not (image_column or video_column or text_column):\n    raise ValueError('specify at least one of image_column, video_column, text_column')","typeGuard":null,"tryCatchPattern":"try:\n    handler = MultimodalHandler(columns=cols)\nexcept ValueError as e:\n    if 'at least one input column' in str(e):\n        handler = MultimodalHandler(columns=cols, text_column='text')","preventionTips":["Always pass explicit input column names to multimodal handlers","Match column names to your PCollection schema"],"tags":["python","vertex-ai","embeddings","validation"],"backgroundTag":"missing-required-argument","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}