{"record":{"id":"210ddb3902dd07b3","repo":"apache/beam","slug":"this-provider-of-type-s-does-not-support-additional","errorCode":null,"errorMessage":"This provider of type %s does not support additional dependencies.","messagePattern":"This provider of type (.+?) does not support additional dependencies\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/yaml/yaml_provider.py","lineNumber":165,"sourceCode":"    return a._affinity(b) + b._affinity(a)\n\n  def _affinity(self, other: \"Provider\"):\n    if self is other or self == other:\n      return 100\n    elif type(self) == type(other):\n      return 10\n    else:\n      return 0\n\n  @functools.cache  # pylint: disable=method-cache-max-size-none\n  def with_extra_dependencies(self, dependencies: Iterable[str]):\n    result = self._with_extra_dependencies(dependencies)\n    if not hasattr(result, 'to_json'):\n      result.to_json = lambda: {'type': type(result).__name__}\n    return result\n\n  def _with_extra_dependencies(self, dependencies: Iterable[str]):\n    raise ValueError(\n        'This provider of type %s does not support additional dependencies.' %\n        type(self).__name__)\n\n\ndef as_provider(name, provider_or_constructor):\n  if isinstance(provider_or_constructor, Provider):\n    return provider_or_constructor\n  else:\n    return InlineProvider({name: provider_or_constructor})\n\n\ndef as_provider_list(name, lst):\n  if not isinstance(lst, list):\n    return as_provider_list(name, [lst])\n  return [as_provider(name, x) for x in lst]\n\n\nclass ExternalProvider(Provider):","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/yaml/yaml_provider.py#L147-L183","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Remove the extra-dependencies request for this provider type.","Use a provider type that overrides _with_extra_dependencies (e.g. one that supports pip dependency installation).","Install the needed packages into the environment before launching the pipeline instead of declaring them on the provider."],"exampleFix":"// before\n- type: MyProvider\n  dependencies: [pandas]\n// after\n- type: MyProvider\n# and: pip install pandas in the launch environment","handlingStrategy":"validation","validationCode":"if hasattr(provider, '_with_extra_dependencies') and Provider._with_extra_dependencies.__code__ is getattr(type(provider), '_with_extra_dependencies').__code__:\n    raise SystemExit(f'{type(provider).__name__} does not support extra dependencies')","typeGuard":"def supports_extra_deps(p) -> bool:\n    return type(p)._with_extra_dependencies is not Provider._with_extra_dependencies","tryCatchPattern":"try:\n    p = with_extra_dependencies(provider, deps)\nexcept ValueError as e:\n    log.warning('Provider lacks dependency support, installing manually: %s', e)\n    p = provider","preventionTips":["Check the provider class documentation before adding dependency options.","Prefer installing packages in the launch environment over declaring them on providers.","Centralize provider construction so dependency support can be asserted in one place."],"tags":["python","apache-beam","yaml","provider","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}