apache/beam · error · ValueError

_not_found_err_message(self.feature_store_name…

Error message

_not_found_err_message(self.feature_store_name, self.feature_view_name, entity_id)

What it means

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.

Solutions

  1. Set exception_level=ExceptionLevel.WARN on the handler if missing entities are acceptable (returns an empty beam.Row instead).
  2. Backfill or correct the missing entity_id in Vertex AI Feature Store.
  3. Filter or fix rows whose key column is stale before enrichment.

Example fix

// before
handler = VertexAIFeatureStoreEnrichment('store', 'view', 'user_id')
// after
handler = VertexAIFeatureStoreEnrichment('store', 'view', 'user_id', exception_level=ExceptionLevel.WARN)
Defensive patterns

Strategy: try-catch

Validate before calling

handler = VertexAIFeatureStoreEnrichment('fs', 'fv', 'user_id', exception_level=ExceptionLevel.WARN)
# missing entities now yield beam.Row() instead of raising

Try / catch

try:
    result = rows | Enrichment(handler)
except ValueError as e:
    logging.warning('Feature lookup miss: %s', e)

Prevention

When it happens

Trigger: __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.

Common situations: 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.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/f023ae0893117460. Report an issue: GitHub.

Appendix: source

Thrown at sdks/python/apache_beam/transforms/enrichment_handlers/vertex_ai_feature_store.py:177

          "contain a field: %s in the input `beam.Row` to join "
          "the input with fetched response. This is used as the "
          "`FeatureViewDataKey` to fetch feature values "
          "corresponding to this key." % self.row_key)
    try:
      response = self.client.fetch_feature_values(
          request=aiplatform.gapic.FetchFeatureValuesRequest(
              data_key=aiplatform.gapic.FeatureViewDataKey(key=entity_id),
              feature_view=self.feature_view_path,
              data_format=aiplatform.gapic.FeatureViewDataFormat.PROTO_STRUCT,
          ))
    except NotFound:
      if self.exception_level == ExceptionLevel.WARN:
        _LOGGER.warning(
            _not_found_err_message(
                self.feature_store_name, self.feature_view_name, entity_id))
        return request, beam.Row()
      elif self.exception_level == ExceptionLevel.RAISE:
        raise ValueError(
            _not_found_err_message(
                self.feature_store_name, self.feature_view_name, entity_id))
    response_dict = dict(response.proto_struct)
    return request, beam.Row(**response_dict)

  def __exit__(self, exc_type, exc_val, exc_tb):
    """Clean the instantiated Vertex AI client."""
    self.client = None

  def get_cache_key(self, request: beam.Row) -> str:
    """Returns a string formatted with unique entity-id for the feature values.
    """
    return 'entity_id: %s' % request._asdict()[self.row_key]


class VertexAIFeatureStoreLegacyEnrichmentHandler(EnrichmentSourceHandler):
  """Enrichment handler to interact with Vertex AI Feature Store (Legacy).

View on GitHub (pinned to 12126d8942)