apache/beam · error · ValueError

Unexpected parameters in provider of type {type} at line {Sa

Error message

Unexpected parameters in provider of type {type} at line {SafeLineLoader.get_line(spec)}: {extra_params}

What it means

provider_from_spec (yaml_provider.py:276) whitelists the keys 'transforms', 'type' and 'config' in a provider spec; any other key triggers a ValueError listing the extra parameters and the spec's line number. This catches typos and misplaced options early instead of silently ignoring them.

Source

Thrown at sdks/python/apache_beam/yaml/yaml_provider.py:276

        external.ImplicitSchemaPayloadBuilder(args).payload(),
        self._service)

  @classmethod
  def provider_from_spec(cls, source_path, spec):
    from apache_beam.yaml.yaml_transform import SafeLineLoader
    for required in ('type', 'transforms'):
      if required not in spec:
        raise ValueError(
            f'Missing {required} in provider '
            f'at line {SafeLineLoader.get_line(spec)}')
    urns = SafeLineLoader.strip_metadata(spec['transforms'])
    type = spec['type']
    config = SafeLineLoader.strip_metadata(spec.get('config', {}))
    extra_params = set(SafeLineLoader.strip_metadata(spec).keys()) - {
        'transforms', 'type', 'config'
    }
    if extra_params:
      raise ValueError(
          f'Unexpected parameters in provider of type {type} '
          f'at line {SafeLineLoader.get_line(spec)}: {extra_params}')
    if config.get('version', None) == 'BEAM_VERSION':
      config['version'] = beam_version
    if type in cls._provider_types:
      try:
        constructor = cls._provider_types[type]
        if 'provider_base_path' in inspect.signature(constructor).parameters:
          config['provider_base_path'] = source_path
        result = constructor(urns, **config)
        if not hasattr(result, 'to_json'):
          result.to_json = lambda: spec
        return result
      except Exception as exn:
        raise ValueError(
            f'Unable to instantiate provider of type {type} '
            f'at line {SafeLineLoader.get_line(spec)}: {exn}') from exn
    else:

View on GitHub (pinned to 12126d8942)

Solutions

  1. Move unexpected keys inside the 'config:' sub-mapping of the provider spec.
  2. Fix typos in 'type'/'transforms'/'config' key names.
  3. Remove keys that are not part of the provider spec schema at the reported line.

Example fix

# before
- type: javaJar
  jar: my.jar
  transforms: {...}
# after
- type: javaJar
  config:
    jar: my.jar
  transforms: {...}
Defensive patterns

Strategy: validation

Validate before calling

ALLOWED = {'type', 'transforms', 'config'}
extra = set(spec) - ALLOWED
if extra:
    raise SystemExit(f'Move unexpected provider keys into config: {extra}')

Try / catch

try:
    provider = ExternalProvider.provider_from_spec(src, spec)
except ValueError as e:
    log.error('Provider spec rejected: %s', e)
    raise

Prevention

When it happens

Trigger: A provider spec containing keys outside {type, transforms, config}, e.g. 'jars:', 'version:' placed at provider level, or a misspelled 'configs'.

Common situations: Users moving config options up a level out of 'config'; copying examples for other provider syntaxes; typos like 'transform' instead of 'transforms'.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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