{"record":{"id":"3c46675d54e8f29f","repo":"apache/beam","slug":"unsupported-method-method-to-use","errorCode":null,"errorMessage":"Unsupported method {method_to_use}","messagePattern":"Unsupported method (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/io/gcp/bigquery.py","lineNumber":2490,"sourceCode":"    elif method_to_use == WriteToBigQuery.Method.STORAGE_WRITE_API:\n      return pcoll | StorageWriteToBigQuery(\n          table=self.table_reference,\n          schema=self.schema,\n          table_side_inputs=self.table_side_inputs,\n          create_disposition=self.create_disposition,\n          write_disposition=self.write_disposition,\n          additional_bq_parameters=self.additional_bq_parameters,\n          triggering_frequency=self.triggering_frequency,\n          use_at_least_once=self.use_at_least_once,\n          with_auto_sharding=self.with_auto_sharding,\n          num_storage_api_streams=self._num_storage_api_streams,\n          use_cdc_writes=self._use_cdc_writes,\n          primary_key=self._primary_key,\n          big_lake_configuration=self._big_lake_configuration,\n          expansion_service=self.expansion_service,\n          type_overrides=self._type_overrides)\n    else:\n      raise ValueError(f\"Unsupported method {method_to_use}\")\n\n  def display_data(self):\n    res = {}\n    if self.table_reference is not None and isinstance(self.table_reference,\n                                                       TableReference):\n      tableSpec = '{}.{}'.format(\n          self.table_reference.datasetId, self.table_reference.tableId)\n      if self.table_reference.projectId is not None:\n        tableSpec = '{}:{}'.format(self.table_reference.projectId, tableSpec)\n      res['table'] = DisplayDataItem(tableSpec, label='Table')\n\n    res['validation'] = DisplayDataItem(\n        self._validate, label=\"Validation Enabled\")\n    return res\n\n  def to_runner_api_parameter(self, context):\n    from apache_beam.internal import pickler\n","sourceCodeStart":2472,"sourceCodeEnd":2508,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/io/gcp/bigquery.py#L2472-L2508","documentation":"WriteToBigQuery.expand() exhausts its known write methods (STREAMING_INSERTS, FILE_LOADS, STORAGE_WRITE_API, STORAGE_API_AT_LEAST_ONCE, etc.) and raises ValueError for anything else. The method value passed the constructor but did not map to an implementation branch.","triggerScenarios":"Passing method= an unrecognized string or an unsupported Method enum value to WriteToBigQuery and expanding the pipeline.","commonSituations":"Typo in method string (e.g. 'STOARGE_WRITE_API'); using a method added in a newer Beam version while running an older one; building the method name dynamically.","solutions":["Use one of WriteToBigQuery.Method.STREAMING_INSERTS, FILE_LOADS, or STORAGE_WRITE_API enum values.","Upgrade apache-beam to a version that supports the desired method.","Validate the method value before constructing the transform."],"exampleFix":"// before\nWriteToBigQuery(table='proj:ds.tbl', method='STORAGE-API')\n// after\nWriteToBigQuery(table='proj:ds.tbl', method=WriteToBigQuery.Method.STORAGE_WRITE_API)","handlingStrategy":"validation","validationCode":"from apache_beam.io.gcp.bigquery import WriteToBigQuery\nvalid = set(WriteToBigQuery.Method)\nassert method in valid or method in {m.value for m in valid}, f'unsupported method {method}'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Reference WriteToBigQuery.Method enum members instead of raw strings.","Pin your Beam version and check the enum before config-driven method selection."],"tags":["apache-beam","bigquery","invalid-enum-value"],"backgroundTag":"invalid-enum-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"}