{"record":{"id":"f4406198b8221a1e","repo":"apache/beam","slug":"no-matching-row-found-for-row-key-s-with-row-filter-s","errorCode":null,"errorMessage":"no matching row found for row_key: %s with row_filter=%s","messagePattern":"no matching row found for row_key: (.+?) with row_filter=(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/transforms/enrichment_handlers/bigtable.py","lineNumber":143,"sourceCode":"        row_key = row_key_str.encode(self._encoding)\n      row = self._table.read_row(row_key, filter_=self._row_filter)\n      if row:\n        for cf_id, cf_v in row.cells.items():\n          response_dict[cf_id] = {}\n          for col_id, col_v in cf_v.items():\n            if self._include_timestamp:\n              response_dict[cf_id][col_id.decode(self._encoding)] = [\n                  (v.value.decode(self._encoding), v.timestamp) for v in col_v\n              ]\n            else:\n              response_dict[cf_id][col_id.decode(\n                  self._encoding)] = col_v[0].value.decode(self._encoding)\n      elif self._exception_level == ExceptionLevel.WARN:\n        _LOGGER.warning(\n            'no matching row found for row_key: %s '\n            'with row_filter: %s' % (row_key_str, self._row_filter))\n      elif self._exception_level == ExceptionLevel.RAISE:\n        raise ValueError(\n            'no matching row found for row_key: %s '\n            'with row_filter=%s' % (row_key_str, self._row_filter))\n    except KeyError:\n      raise KeyError('row_key %s not found in input PCollection.' % row_key_str)\n    except NotFound:\n      raise NotFound(\n          'GCP BigTable cluster `%s:%s:%s` not found.' %\n          (self._project_id, self._instance_id, self._table_id))\n    except Exception as e:\n      raise e\n\n    return request, beam.Row(**response_dict)\n\n  def __exit__(self, exc_type, exc_val, exc_tb):\n    \"\"\"Clean the instantiated BigTable client.\"\"\"\n    self.client = None\n    self.instance = None\n    self._table = None","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/transforms/enrichment_handlers/bigtable.py#L125-L161","documentation":"Raised by BigTableEnrichmentHandler.__call__ when a BigTable lookup for the computed row key returned no rows and the handler's exception_level is set to RAISE (a ValueError). The handler can instead log a warning (WARN) or continue silently, but at RAISE level an unmatched row key fails the element. A related KeyError path indicates the row key field itself was absent from the input row.","triggerScenarios":"Calling the handler on a row whose extracted row_key does not exist in the BigTable (given the configured row_filter), with BigTableEnrichmentHandler(..., exception_level=ExceptionLevel.RAISE).","commonSituations":"Row keys missing due to data lag (enrichment source not yet populated); wrong row key format (e.g. missing prefix/padding used by the writing pipeline); row_filter excluding the row; pointing at the wrong table or instance.","solutions":["Verify the row_key_fn/row_key produces keys that exactly match keys written to BigTable (encoding, prefix, zero-padding).","Check the configured row_filter and table/instance ids point at the data you expect.","Set exception_level=ExceptionLevel.WARN if unmatched rows should be tolerated instead of failing the pipeline.","Fix upstream data so the referenced rows exist before enrichment runs."],"exampleFix":"# before\nh = bigtable.BigTableEnrichmentHandler(..., exception_level=ExceptionLevel.RAISE)\n# after (tolerate missing rows)\nh = bigtable.BigTableEnrichmentHandler(..., exception_level=ExceptionLevel.WARN)","handlingStrategy":"fallback","validationCode":"key = row_key_fn(row)\n# pre-check against a known key set or ensure upstream write completed before enrichment","typeGuard":"def extractable_key(row, field='key'):\n    return row if field in row._asdict() else None","tryCatchPattern":"try:\n    enriched = pcoll | Enrichment(handler)\nexcept ValueError as e:\n    if 'no matching row found' in str(e):\n        logging.warning('unmatched BigTable key, using original row: %s', e)\n    else:\n        raise","preventionTips":["Verify key formatting (padding, prefixes, encoding) matches the writer.","Set exception_level=WARN when occasional misses are acceptable.","Confirm the row exists in BigTable (e.g. via a manual read) before pipeline runs.","Double-check instance_id, table_id, and row_filter settings."],"tags":["python","apache-beam","bigtable","lookup","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}