apache/beam · error · NotImplementedError

%s=%s not supported for %s

Error message

%s=%s not supported for %s

What it means

This validation wrapper checks every (key, value) kwarg of a pandas API function against a whitelist of supported values before dispatching to the Beam implementation. If a kwarg's value is not in the supported set, it raises NotImplementedError, since the Beam DataFrame API implements only a subset of pandas parameters.

Source

Thrown at sdks/python/apache_beam/dataframe/frame_base.py:266

        value = kwargs[key]
      else:
        try:
          ix = getfullargspec(func).args.index(key)
        except ValueError:
          # TODO: fix for delegation?
          continue
        if len(args) <= ix:
          continue
        value = args[ix]
      if callable(values):
        check = values
      elif isinstance(values, list):
        check = lambda x, values=values: x in values
      else:
        check = lambda x, value=value: x == value

      if not check(value):
        raise NotImplementedError(
            '%s=%s not supported for %s' % (key, value, name))
    deferred_arg_indices = []
    deferred_arg_exprs = []
    constant_args = [None] * len(args)
    from apache_beam.dataframe.frames import _DeferredIndex
    for ix, arg in enumerate(args):
      if isinstance(arg, DeferredBase):
        deferred_arg_indices.append(ix)
        deferred_arg_exprs.append(arg._expr)
      elif isinstance(arg, _DeferredIndex):
        # TODO(robertwb): Consider letting indices pass through as indices.
        # This would require updating the partitioning code, as indices don't
        # have indices.
        deferred_arg_indices.append(ix)
        deferred_arg_exprs.append(
            expressions.ComputedExpression(
                'index_as_series',
                lambda ix: ix.index.to_series(),  # yapf break

View on GitHub (pinned to 12126d8942)

Solutions

  1. Remove or change the unsupported kwarg to a supported/default value.
  2. Implement the behavior manually in a map/DoFn or after converting the data to a concrete pandas DataFrame outside the pipeline.
  3. Check the Beam DataFrame API capability summary to see which kwargs are supported per method.

Example fix

// before
df2 = df.sort_values('col', kind='mergesort')
// after
df2 = df.sort_values('col')  # only default kind supported
Defensive patterns

Strategy: validation

Validate before calling

SUPPORTED = {'kind': {'quicksort'}, 'dropna': {True}}
if key in SUPPORTED and value not in SUPPORTED[key]:
    raise NotImplementedError(f'{key}={value} not supported')

Type guard

def kwarg_supported(key: str, value) -> bool:
    supported = {'kind': {'quicksort'}, 'interpolation': {'linear'}}
    return key not in supported or value in supported[key]

Try / catch

try:
    out = df.sort_values('col', kind='mergesort')
except NotImplementedError:
    out = df.sort_values('col')

Prevention

When it happens

Trigger: Calling a supported pandas-like method with an unsupported keyword value, e.g. df.sort_values(..., kind='mergesort'), df.nunique(dropna=False), df.quantile(interpolation='nearest'), or df.duplicated(keep='last') where that value isn't implemented.

Common situations: Copy-pasting pandas code into a Beam dataframe pipeline without pruning exotic kwargs; parameters whose default is supported but non-default values are not; pandas version drift introducing new kwarg values the Beam shim doesn't recognize.

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/059f33c87e0d1425. Report an issue: GitHub.