{"record":{"id":"57498d8cb812af7f","repo":"apache/beam","slug":"not-found-err-message-self-feature-store-id-self-entity-type","errorCode":null,"errorMessage":"_not_found_err_message(self.feature_store_id, self.entity_type_id, entity_id)","messagePattern":"_not_found_err_message\\(self\\.feature_store_id, self\\.entity_type_id, entity_id\\)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/transforms/enrichment_handlers/vertex_ai_feature_store.py","lineNumber":302,"sourceCode":"      entity_id = request._asdict()[self.row_key]\n    except KeyError:\n      raise KeyError(\n          \"Enrichment requests to Vertex AI Feature Store should \"\n          \"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\n    try:\n      selector = aiplatform.gapic.FeatureSelector(\n          id_matcher=aiplatform.gapic.IdMatcher(ids=self.feature_ids))\n      response = self.client.read_feature_values(\n          request=aiplatform.gapic.ReadFeatureValuesRequest(\n              entity_type=self.entity_type_path,\n              entity_id=entity_id,\n              feature_selector=selector))\n    except NotFound:\n      raise ValueError(\n          _not_found_err_message(\n              self.feature_store_id, self.entity_type_id, entity_id))\n\n    response_dict = {}\n    proto_to_dict = proto.Message.to_dict(response.entity_view)\n    for key, msg in zip(response.header.feature_descriptors,\n                        proto_to_dict['data']):\n      if msg and 'value' in msg:\n        response_dict[key.id] = list(msg['value'].values())[0]\n        # skip fetching the metadata\n      elif self.exception_level == ExceptionLevel.RAISE:\n        raise ValueError(\n            _not_found_err_message(\n                self.feature_store_id, self.entity_type_id, entity_id))\n      elif self.exception_level == ExceptionLevel.WARN:\n        _LOGGER.warning(\n            _not_found_err_message(\n                self.feature_store_id, self.entity_type_id, entity_id))","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/transforms/enrichment_handlers/vertex_ai_feature_store.py#L284-L320","documentation":"In the legacy handler's __call__, a NotFound from the ReadFeatureValues RPC (entity id absent from the EntityType) is converted to ValueError with _not_found_err_message(feature_store_id, entity_type_id, entity_id).","triggerScenarios":"read_feature_values raised NotFound because entity_id does not exist in the entity_type_path while exception_level is RAISE.","commonSituations":"Entity never ingested, deleted entity, or rows keyed against the wrong EntityType/store after refactoring.","solutions":["Use exception_level=ExceptionLevel.WARN to tolerate missing entities.","Ingest the missing entity into the EntityType or fix stale keys upstream.","Verify feature_store_id/entity_type_id point at the intended resource."],"exampleFix":"// before\nVertexAIEntityTypeEnrichment('fs', 'et', 'user_id')\n// after\nVertexAIEntityTypeEnrichment('fs', 'et', 'user_id', exception_level=ExceptionLevel.WARN)","handlingStrategy":"try-catch","validationCode":"handler = LegacyHandler('fs', 'et', 'user_id', exception_level=ExceptionLevel.WARN)","typeGuard":null,"tryCatchPattern":"try:\n    result = rows | Enrichment(handler)\nexcept ValueError as e:\n    logging.warning('Entity not found: %s', e)","preventionTips":["Use exception_level=WARN for partial-coverage key sets.","Keep entity ingestion pipelines ahead of enrichment consumers."],"tags":["vertex-ai","not-found","enrichment","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"}