{"record":{"id":"079fee58d7de41e8","repo":"apache/beam","slug":"invalid-input-pcolls-specified-there-should-be-at-least-2","errorCode":null,"errorMessage":"Invalid input {pcolls} specified. There should be at least 2 inputs to join.","messagePattern":"Invalid input (.+?) specified\\. There should be at least 2 inputs to join\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/yaml/yaml_join.py","lineNumber":32,"sourceCode":"# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n\"\"\"This module defines the Join operation.\"\"\"\nfrom typing import Any\nfrom typing import Optional\nfrom typing import Union\n\nimport apache_beam as beam\nfrom apache_beam.yaml import yaml_provider\n\n\ndef _validate_input(pcolls):\n  error_prefix = f'Invalid input {pcolls} specified.'\n  if not isinstance(pcolls, dict):\n    raise ValueError(f'{error_prefix} It must be a dict.')\n  if len(pcolls) < 2:\n    raise ValueError(\n        f'{error_prefix} There should be at least 2 inputs to join.')\n\n\ndef _validate_type(type, pcolls):\n  error_prefix = f'Invalid value \"{type}\" for \"type\".'\n  if not isinstance(type, dict) and not isinstance(type, str):\n    raise ValueError(f'{error_prefix} It must be a dict or a str.')\n  if isinstance(type, dict):\n    error = ValueError(\n        f'{error_prefix} When specifying a dict for type, '\n        f'it must follow this format: '\n        f'{{\"outer\": [list of inputs to outer join]}}. '\n        f'Example: {{\"outer\": [\"input1\", \"input2\"]}}')\n    if (len(type) != 1 or next(iter(type)) != 'outer' or\n        not isinstance(type['outer'], list)):\n      raise error\n    for input in type['outer']:\n      if input not in list(pcolls.keys()):","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/yaml/yaml_join.py#L14-L50","documentation":"_validate_input, called by the YAML Join transform's expansion, found fewer than two input PCollections; joining is a binary-or-more operation, so a single (or empty) input dict has nothing to join together.","triggerScenarios":"Calling _SqlJoinTransform with a dict containing 0 or 1 entries, e.g. {'input1': pc1} or {}.","commonSituations":"YAML pipelines where some inputs were removed but the join transform left in place; dynamically built pipelines where conditional inputs were dropped; copy-paste leaving only one input.","solutions":["Provide at least two named PCollections as inputs.","If only one input exists, remove the join or replace it with a map/SQL transform.","Check upstream conditional logic that may have omitted inputs."],"exampleFix":"// before\njoin({'input1': pc1})\n// after\njoin({'input1': pc1, 'input2': pc2})","handlingStrategy":"validation","validationCode":"if len(inputs) < 2:\n    raise ValueError('Join requires at least 2 inputs')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check that all conditional input branches actually exist before the join","Remove join transforms when reducing pipeline inputs below two","Validate the pipeline spec with beam_yaml before running"],"tags":["apache-beam","yaml","join","validation"],"backgroundTag":"invalid-argument-value","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"}