{"record":{"id":"f023ae0893117460","repo":"apache/beam","slug":"not-found-err-message-self-feature-store-name-self-feature","errorCode":null,"errorMessage":"_not_found_err_message(self.feature_store_name, self.feature_view_name, entity_id)","messagePattern":"_not_found_err_message\\(self\\.feature_store_name, self\\.feature_view_name, entity_id\\)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/transforms/enrichment_handlers/vertex_ai_feature_store.py","lineNumber":177,"sourceCode":"          \"contain a field: %s in the input `beam.Row` to join \"\n          \"the input with fetched response. This is used as the \"\n          \"`FeatureViewDataKey` to fetch feature values \"\n          \"corresponding to this key.\" % self.row_key)\n    try:\n      response = self.client.fetch_feature_values(\n          request=aiplatform.gapic.FetchFeatureValuesRequest(\n              data_key=aiplatform.gapic.FeatureViewDataKey(key=entity_id),\n              feature_view=self.feature_view_path,\n              data_format=aiplatform.gapic.FeatureViewDataFormat.PROTO_STRUCT,\n          ))\n    except NotFound:\n      if self.exception_level == ExceptionLevel.WARN:\n        _LOGGER.warning(\n            _not_found_err_message(\n                self.feature_store_name, self.feature_view_name, entity_id))\n        return request, beam.Row()\n      elif self.exception_level == ExceptionLevel.RAISE:\n        raise ValueError(\n            _not_found_err_message(\n                self.feature_store_name, self.feature_view_name, entity_id))\n    response_dict = dict(response.proto_struct)\n    return request, beam.Row(**response_dict)\n\n  def __exit__(self, exc_type, exc_val, exc_tb):\n    \"\"\"Clean the instantiated Vertex AI client.\"\"\"\n    self.client = None\n\n  def get_cache_key(self, request: beam.Row) -> str:\n    \"\"\"Returns a string formatted with unique entity-id for the feature values.\n    \"\"\"\n    return 'entity_id: %s' % request._asdict()[self.row_key]\n\n\nclass VertexAIFeatureStoreLegacyEnrichmentHandler(EnrichmentSourceHandler):\n  \"\"\"Enrichment handler to interact with Vertex AI Feature Store (Legacy).\n","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/transforms/enrichment_handlers/vertex_ai_feature_store.py#L159-L195","documentation":"When the Vertex AI Feature Store lookup returns NotFound for an entity id, the handler formats a 'not found' message via _not_found_err_message(feature_store_name, feature_view_name, entity_id). With exception_level=RAISE it raises ValueError with this message; with WARN it only logs it.","triggerScenarios":"__call__ catches NotFound from the FeaturestoreOnlineServingService read_feature_values call (the FeatureView lookup found no values for entity_id) while exception_level is ExceptionLevel.RAISE.","commonSituations":"Enriching rows whose entity id was never ingested into the FeatureView, stale/deleted entities, or ids read from the wrong feature store/view after a rename.","solutions":["Set exception_level=ExceptionLevel.WARN on the handler if missing entities are acceptable (returns an empty beam.Row instead).","Backfill or correct the missing entity_id in Vertex AI Feature Store.","Filter or fix rows whose key column is stale before enrichment."],"exampleFix":"// before\nhandler = VertexAIFeatureStoreEnrichment('store', 'view', 'user_id')\n// after\nhandler = VertexAIFeatureStoreEnrichment('store', 'view', 'user_id', exception_level=ExceptionLevel.WARN)","handlingStrategy":"try-catch","validationCode":"handler = VertexAIFeatureStoreEnrichment('fs', 'fv', 'user_id', exception_level=ExceptionLevel.WARN)\n# missing entities now yield beam.Row() instead of raising","typeGuard":null,"tryCatchPattern":"try:\n    result = rows | Enrichment(handler)\nexcept ValueError as e:\n    logging.warning('Feature lookup miss: %s', e)","preventionTips":["Set exception_level=WARN when enrichment misses are acceptable.","Reconcile input keys against the FeatureView contents periodically.","Monitor the WARN log rate to detect stale keys."],"tags":["vertex-ai","enrichment","not-found","beam","lookup"],"backgroundTag":"entity-not-found","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"}