{"record":{"id":"99fd2aa97f179e36","repo":"apache/beam","slug":"gcp-dependencies-not-installed-cannot-use-enrichment-handler","errorCode":null,"errorMessage":"gcp dependencies not installed. Cannot use {enrichment_handler} handler. Please install using 'pip install apache-beam[gcp]'.","messagePattern":"gcp dependencies not installed\\. Cannot use (.+?) handler\\. Please install using 'pip install apache-beam\\[gcp\\]'\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/yaml/yaml_enrichment.py","lineNumber":87,"sourceCode":"    Args:\n        enrichment_handler (str): Specifies the source from where data needs\n          to be extracted into the pipeline for enriching data. One of\n          \"BigQuery\", \"BigTable\", \"FeastFeatureStore\" or \"VertexAIFeatureStore\".\n        handler_config (str): Specifies the parameters for the respective\n          enrichment_handler in a YAML/JSON format. To see the full set of\n          handler_config parameters, see their corresponding doc pages:\n\n            - [BigQueryEnrichmentHandler](https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.enrichment_handlers.bigquery.html#apache_beam.transforms.enrichment_handlers.bigquery.BigQueryEnrichmentHandler)\n            - [BigTableEnrichmentHandler](https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.enrichment_handlers.bigtable.html#apache_beam.transforms.enrichment_handlers.bigtable.BigTableEnrichmentHandler)\n            - [FeastFeatureStoreEnrichmentHandler](https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.enrichment_handlers.feast_feature_store.html#apache_beam.transforms.enrichment_handlers.feast_feature_store.FeastFeatureStoreEnrichmentHandler)\n            - [VertexAIFeatureStoreEnrichmentHandler](https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.html#apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.VertexAIFeatureStoreEnrichmentHandler)\n        timeout (float): Timeout for source requests in seconds. Defaults to 30\n          seconds.\n    \"\"\"\n  options.YamlOptions.check_enabled(pcoll.pipeline, 'Enrichment')\n\n  if not Enrichment:\n    raise ValueError(\n        f\"gcp dependencies not installed. Cannot use {enrichment_handler} \"\n        f\"handler. Please install using 'pip install apache-beam[gcp]'.\")\n\n  if (enrichment_handler == 'FeastFeatureStore' and\n      not FeastFeatureStoreEnrichmentHandler):\n    raise ValueError(\n        \"FeastFeatureStore handler requires 'feast' package to be installed. \" +\n        \"Please install using 'pip install feast[gcp]' and try again.\")\n\n  handler_map = {\n      'BigQuery': BigQueryEnrichmentHandler,\n      'BigTable': BigTableEnrichmentHandler,\n      'FeastFeatureStore': FeastFeatureStoreEnrichmentHandler,\n      'VertexAIFeatureStore': VertexAIFeatureStoreEnrichmentHandler\n  }\n\n  if enrichment_handler not in handler_map:\n    raise ValueError(f\"Unknown enrichment source: {enrichment_handler}\")","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/yaml/yaml_enrichment.py#L69-L105","documentation":"enrichment_transform in apache_beam.yaml.yaml_enrichment raises ValueError when the Enrichment transform is used but the apache-beam[gcp] extra isn't installed, so the Enrichment module (and handlers like FeastFeatureStore) couldn't be imported. The handler therefore cannot run.","triggerScenarios":"YAML pipeline uses Enrichment with a GCP-backed handler (e.g. VertexAIFeatureStore, FeastFeatureStore) while apache_beam.yaml.yaml_enrichment failed to import Enrichment because google-cloud dependencies are absent.","commonSituations":"Slim/base Beam installs (no [gcp] extra) deployed to runners; container images without google-cloud-* packages; local venvs created with `pip install apache-beam` instead of `apache-beam[gcp]`.","solutions":["Install the extra: pip install 'apache-beam[gcp]'.","Rebuild/pin the runner container image to include the GCP extra dependencies.","Add the dependency to requirements.txt/setup.py used by Dataflow so workers install it at launch."],"exampleFix":"// before\npip install apache-beam\n// after\npip install 'apache-beam[gcp]'","handlingStrategy":"fallback","validationCode":"try:\n    from apache_beam.transforms.enrichment import Enrichment\n    gcp_ok = True\nexcept ImportError:\n    gcp_ok = False\nif not gcp_ok:\n    raise SystemExit(\"Install GCP extra: pip install 'apache-beam[gcp]'\")","typeGuard":"def gcp_extra_installed() -> bool:\n    import importlib.util\n    return importlib.util.find_spec('apache_beam.transforms.enrichment') is not None","tryCatchPattern":"try:\n    enrichment_transform(pcoll, enrichment_handler=handler, ...)\nexcept ValueError as e:\n    if 'gcp dependencies not installed' in str(e):\n        raise SystemExit(\"Run: pip install 'apache-beam[gcp]' and redeploy\") from e\n    raise","preventionTips":["Always install with the [gcp] extra in envs using GCP-backed transforms","Add apache-beam[gcp] to requirements.txt passed to Dataflow","Smoke-test imports in CI before deploying YAML pipelines","Pin the container image to one that includes google-cloud dependencies"],"tags":["dependencies","gcp","beam-yaml"],"backgroundTag":"missing-optional-dependency","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"}