apache/beam · error · ValueError
Please provide exactly one of a list of feature names to fet
Error message
Please provide exactly one of a list of feature names to fetch from online store (`feature_names`) or a feature service name for the Feast online feature store (`feature_service_name`).
What it means
Validation in `_validate_feature_names`, invoked from the handler's `__init__`, requires exactly one of `feature_names` (list) or `feature_service_name`. Passing neither, or passing both, raises this ValueError because the handler cannot decide how to resolve features from the Feast online store.
Source
Thrown at sdks/python/apache_beam/transforms/enrichment_handlers/feast_feature_store.py:61
def download_fs_yaml_file(gcs_fs_yaml_file: str):
"""Download the feature store config file for Feast."""
try:
with FileSystems.open(gcs_fs_yaml_file, 'r') as gcs_file:
with tempfile.NamedTemporaryFile(suffix=LOCAL_FEATURE_STORE_YAML_FILENAME,
delete=False) as local_file:
local_file.write(gcs_file.read())
return Path(local_file.name)
except Exception:
raise RuntimeError(
'error downloading the file %s locally to load the '
'Feast feature store.' % gcs_fs_yaml_file)
def _validate_feature_names(feature_names, feature_service_name):
"""Check if one of `feature_names` or `feature_service_name` is provided."""
if ((not feature_names and not feature_service_name) or
bool(feature_names and feature_service_name)):
raise ValueError(
'Please provide exactly one of a list of feature names to fetch '
'from online store (`feature_names`) or a feature service name for '
'the Feast online feature store (`feature_service_name`).')
def _validate_feature_store_yaml_path_exists(fs_yaml_file):
"""Check if the feature store yaml path exists."""
if not FileSystems.exists(fs_yaml_file):
raise ValueError(
'The feature store yaml path (%s) does not exist.' % fs_yaml_file)
def _validate_entity_key_exists(entity_id, entity_row_fn):
"""Checks if the entity key or a lambda to build entity key exists."""
if ((not entity_row_fn and not entity_id) or
bool(entity_row_fn and entity_id)):
raise ValueError(
"Please specify exactly one of a `entity_id` or a lambda "View on GitHub (pinned to 12126d8942)
Solutions
- Pass exactly one of `feature_names` or `feature_service_name`; delete the other argument.
- If migrating to a feature service, remove the `feature_names` list entirely (empty list still counts as absent, but keep code clean).
- Check defaults in your wrapper/config class that may inject both values.
Example fix
// before FeastFeatureStoreEnrichmentHandler(..., feature_names=['f1'], feature_service_name='daily_fs') // after FeastFeatureStoreEnrichmentHandler(..., feature_service_name='daily_fs')
Defensive patterns
Strategy: validation
Validate before calling
assert bool(feature_names) != bool(feature_service_name), 'provide exactly one of feature_names or feature_service_name'
Prevention
- Use keyword-only parameters so the exclusivity is documented.
- Centralize handler construction in one factory function that enforces exclusivity.
- Never default both options in config files.
When it happens
Trigger: Constructing `FeastFeatureStoreEnrichmentHandler(feature_store_yaml_path=...)` with both `feature_names=[...]` and `feature_service_name='fs'`, or with neither argument (both None/empty).
Common situations: Copy-pasting a config and forgetting to delete the other option; converting from feature_names to feature_service and leaving both; initializing with defaults and forgetting to set either.
Related errors
- Please specify exactly one of a `entity_id` or a lambda func
- MatchContinuously interval must be positive.
- Invalid create disposition %s. Expecting %s
- Invalid write disposition %s. Expecting %s
- Invalid schema update option %s. Expecting %s
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/a3e4cadcac7337af.
Report an issue: GitHub.