{"record":{"id":"6bcc4b946ff4bba3","repo":"apache/beam","slug":"unsupported-query-configuration-type","errorCode":null,"errorMessage":"Unsupported query configuration type","messagePattern":"Unsupported query configuration type","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/transforms/enrichment_handlers/cloudsql.py","lineNumber":584,"sourceCode":"    Returns:\n      List of parameter values\n\n    Raises:\n      KeyError: If required fields are missing from the request\n    \"\"\"\n    try:\n      if isinstance(self._query_config, TableFunctionQueryConfig):\n        return [\n            val for val in self._query_config.where_clause_value_fn(request)\n        ]\n      elif isinstance(self._query_config, TableFieldsQueryConfig):\n        request_dict = request._asdict()\n        return [\n            request_dict[field]\n            for field in self._query_config.where_clause_fields\n        ]\n      else:\n        raise ValueError(\"Unsupported query configuration type\")\n    except KeyError as e:\n      raise KeyError(\n          \"Make sure the values passed in `where_clause_fields` are \"\n          \"the keys in the input `beam.Row`.\" + str(e))\n\n  def _extract_parameter_names(self, template: str) -> list[str]:\n    \"\"\"Extract parameter names from a SQL template string.\n\n    Args:\n      template: SQL template string with named parameters (e.g., \"id = :id\")\n\n    Returns:\n      List of parameter names found in the template (e.g., [\"id\"])\n    \"\"\"\n    return re.findall(r':(\\w+)', template)\n\n  def create_row_key(self, row: beam.Row):\n    if isinstance(self._query_config, TableFunctionQueryConfig):","sourceCodeStart":566,"sourceCodeEnd":602,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/transforms/enrichment_handlers/cloudsql.py#L566-L602","documentation":"_extract_values_from_request pulls where-clause values from the incoming beam.Row based on the active query config; if the config matches none of the supported isinstance branches, it raises ValueError('Unsupported query configuration type').","triggerScenarios":"Passing a custom/unknown QueryConfig subclass (or a config outside CustomQueryConfig/TableFields/TableFunction) to CloudSQLEnrichmentHandler so the isinstance chain matches nothing.","commonSituations":"Implementing a custom QueryConfig subclass and passing it to the handler; factory code returning the wrong config type; version drift introducing a new config type not handled here.","solutions":["Use one of the supported configs: CustomQueryConfig, TableFieldsQueryConfig, or TableFunctionQueryConfig.","If a custom config is needed, extend the handler's extraction logic instead of inventing a new QueryConfig type.","Log type(self._query_config) to confirm what is actually being passed."],"exampleFix":"# before\nhandler = CloudSQLEnrichmentHandler(query_config=MyCustomQueryConfig(...), connection_config=cfg)\n# after\nhandler = CloudSQLEnrichmentHandler(query_config=TableFunctionQueryConfig(...), connection_config=cfg)","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":["python","configuration","cloudsql","type-mismatch"],"backgroundTag":"type-mismatch","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"}