apache/beam · error · ValueError

This provider of type %s does not support additional depende

Error message

This provider of type %s does not support additional dependencies.

What it means

Provider._with_extra_dependencies is the base-class default in yaml_provider.py and simply raises ValueError: only provider subclasses that override it can carry extra dependencies (e.g. pip packages). with_extra_dependencies calls it whenever dependencies are requested on a provider type that did not implement the hook.

Source

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

    return a._affinity(b) + b._affinity(a)

  def _affinity(self, other: "Provider"):
    if self is other or self == other:
      return 100
    elif type(self) == type(other):
      return 10
    else:
      return 0

  @functools.cache  # pylint: disable=method-cache-max-size-none
  def with_extra_dependencies(self, dependencies: Iterable[str]):
    result = self._with_extra_dependencies(dependencies)
    if not hasattr(result, 'to_json'):
      result.to_json = lambda: {'type': type(result).__name__}
    return result

  def _with_extra_dependencies(self, dependencies: Iterable[str]):
    raise ValueError(
        'This provider of type %s does not support additional dependencies.' %
        type(self).__name__)


def as_provider(name, provider_or_constructor):
  if isinstance(provider_or_constructor, Provider):
    return provider_or_constructor
  else:
    return InlineProvider({name: provider_or_constructor})


def as_provider_list(name, lst):
  if not isinstance(lst, list):
    return as_provider_list(name, [lst])
  return [as_provider(name, x) for x in lst]


class ExternalProvider(Provider):

View on GitHub (pinned to 12126d8942)

Solutions

  1. Remove the extra-dependencies request for this provider type.
  2. Use a provider type that overrides _with_extra_dependencies (e.g. one that supports pip dependency installation).
  3. Install the needed packages into the environment before launching the pipeline instead of declaring them on the provider.

Example fix

// before
- type: MyProvider
  dependencies: [pandas]
// after
- type: MyProvider
# and: pip install pandas in the launch environment
Defensive patterns

Strategy: validation

Validate before calling

if hasattr(provider, '_with_extra_dependencies') and Provider._with_extra_dependencies.__code__ is getattr(type(provider), '_with_extra_dependencies').__code__:
    raise SystemExit(f'{type(provider).__name__} does not support extra dependencies')

Type guard

def supports_extra_deps(p) -> bool:
    return type(p)._with_extra_dependencies is not Provider._with_extra_dependencies

Try / catch

try:
    p = with_extra_dependencies(provider, deps)
except ValueError as e:
    log.warning('Provider lacks dependency support, installing manually: %s', e)
    p = provider

Prevention

When it happens

Trigger: Invoking with_extra_dependencies(provider, deps) on a Provider whose class does not override _with_extra_dependencies — e.g. passing extra dependencies in a YAML transform config to a built-in Java external or YamlProvider.

Common situations: YAML pipeline authors adding a 'dependencies:' or extra-deps field to an inline python provider spec or external provider, expecting pip installs, when the provider type has no dependency support.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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