{"record":{"id":"0738c8322369732d","repo":"apache/beam","slug":"test-name-not-provided-in-config","errorCode":null,"errorMessage":"test_name not provided in config.","messagePattern":"test_name not provided in config\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/testing/analyzers/load_test_perf_analysis.py","lineNumber":43,"sourceCode":"\ntry:\n  from google.cloud import bigquery\nexcept ImportError:\n  bigquery = None  # type: ignore\n\n\nclass LoadTestMetricsFetcher(perf_analysis_utils.MetricsFetcher):\n  \"\"\"\n    Metrics fetcher used to get metric data from a BigQuery table. The metrics\n    are fetched and returned as a dataclass containing lists of timestamps and\n    metric_values.\n    \"\"\"\n  def fetch_metric_data(\n      self, *, test_config: TestConfigContainer) -> MetricContainer:\n    if test_config.test_name:\n      test_name, pipeline_name = test_config.test_name.split(',')\n    else:\n      raise Exception(\"test_name not provided in config.\")\n\n    query = f\"\"\"\n      SELECT timestamp, metric.value\n      FROM {test_config.project}.{test_config.metrics_dataset}.{test_config.metrics_table}\n      CROSS JOIN UNNEST(metrics) AS metric\n      WHERE test_name = \"{test_name}\" AND pipeline_name = \"{pipeline_name}\" AND metric.name = \"{test_config.metric_name}\"\n      ORDER BY timestamp DESC\n      LIMIT {constants._NUM_DATA_POINTS_TO_RUN_CHANGE_POINT_ANALYSIS}\n    \"\"\"\n    logging.debug(\"Running query: %s\" % query)\n    if bigquery is None:\n      raise ImportError('Bigquery dependencies are not installed.')\n    client = bigquery.Client()\n    query_job = client.query(query=query)\n    metric_data = query_job.result().to_dataframe()\n    if metric_data.empty:\n      logging.error(\n          \"No results returned from BigQuery. Please check the query.\")","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/testing/analyzers/load_test_perf_analysis.py#L25-L61","documentation":"LoadTestPerfAnalysis.fetch_metric_data queries BigQuery for historical load-test metrics and needs a test_name config field formatted as 'test_name,pipeline_name'. If TestConfigContainer.test_name is empty/None, it raises Exception because the query cannot be built.","triggerScenarios":"Running the analyzer (load_test_perf_analysis.py) with a test config that omits test_name, or provides it without the required 'test_name,pipeline_name' comma format, so the truthiness check `if test_config.test_name` fails.","commonSituations":"Missing or empty test_name in the metrics config passed to the change-point analysis step; YAML/JSON config where the field was renamed or left blank; running analysis outside the automated load-test pipeline where config is normally populated.","solutions":["Add test_name to the test config in the format 'test_name,pipeline_name' (e.g. 'beam_WordCount_IT,PythonWordCount')","Verify the config file/bean used by the analyzer actually loads the field before invoking the analysis","Check for typos between the config schema key and what TestConfigContainer expects"],"exampleFix":"// before (config)\nmetrics_dataset: beam_sample_data\n// test_name missing\n// after (config)\ntest_name: load_test_beam_WordCount_IT,PythonWordCount\nmetrics_dataset: beam_sample_data","handlingStrategy":"validation","validationCode":"if not getattr(test_config, 'test_name', None):\n    raise ValueError('test_config.test_name must be set as \"test_name,pipeline_name\" before analysis')\nif ',' not in test_config.test_name:\n    raise ValueError('test_name must contain test_name,pipeline_name separated by a comma')","typeGuard":null,"tryCatchPattern":"try:\n    metric_data = analyzer.fetch_metric_data(test_config=config)\nexcept Exception as e:\n    if 'test_name not provided in config' in str(e):\n        logging.error('Add test_name (\"name,pipeline\") to the test config and rerun.')\n    else:\n        raise","preventionTips":["Validate the full test config (test_name, project, dataset, table) before starting the analysis","Keep test_name in the canonical 'test,pipeline' comma format","Add a config schema check at pipeline submission time"],"tags":["python","apache-beam","load-testing","config","bigquery"],"backgroundTag":"missing-required-config-field","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"}