apache/beam · error · NotImplementedError

Setting ' ' is not yet supported

Error message

Setting '{key}' is not yet supported

What it means

DeferredFrame.eval()/query() (via _eval_or_query) rejects pandas kwargs local_dict, global_dict, level, target, and resolvers. These require local variable interpolation machinery Beam's expression model does not support, so NotImplementedError is raised.

Solutions

  1. Inline the literal values into the expression string before calling query/eval (e.g. f'a > {threshold!r}')
  2. Drop the unsupported kwargs and rely on column-name-only expressions
  3. Materialize to pandas and call query/eval there

Example fix

// before
result = df.beam.query('a > @limit', local_dict={'limit': limit})
// after
result = df.beam.query(f'a > {limit!r}')
Defensive patterns

Strategy: validation

Validate before calling

BAD = {'local_dict', 'global_dict', 'level', 'target', 'resolvers'}
if BAD & kwargs.keys():
    raise ValueError(f'unsupported query/eval kwargs: {BAD & kwargs.keys()}')

Try / catch

try:
    out = dframe.query(expr)
except NotImplementedError:
    out = dframe.to_pandas().query(expr, local_dict=locals_dict)

Prevention

When it happens

Trigger: Calling df.query('a > @threshold', local_dict=...) or df.eval(...) on a Beam deferred frame while passing any of local_dict, global_dict, level, target, or resolvers kwargs

Common situations: Porting pandas query/eval code that substitutes Python variables into expression strings

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/20175a0285b5b9ab. Report an issue: GitHub.

Appendix: source

Thrown at sdks/python/apache_beam/dataframe/frames.py:3348

      requires_partition_by = partitionings.Singleton(reason=(
          "dropna(axis=1) cannot currently be parallelized. It requires "
          "checking all values in each column for NaN values, to determine "
          "if that column should be dropped."
      ))
    else:
      requires_partition_by = partitionings.Arbitrary()
    return frame_base.DeferredFrame.wrap(
        expressions.ComputedExpression(
            'dropna',
            lambda df: df.dropna(axis=axis, **kwargs),
            [self._expr],
            preserves_partition_by=partitionings.Arbitrary(),
            requires_partition_by=requires_partition_by))

  def _eval_or_query(self, name, expr, inplace, **kwargs):
    for key in ('local_dict', 'global_dict', 'level', 'target', 'resolvers'):
      if key in kwargs:
        raise NotImplementedError(f"Setting '{key}' is not yet supported")

    # look for '@<py identifier>'
    if re.search(r'\@[^\d\W]\w*', expr, re.UNICODE):
      raise NotImplementedError("Accessing locals with @ is not yet supported "
                                "(https://github.com/apache/beam/issues/20626)"
                                )

    result_expr = expressions.ComputedExpression(
        name,
        lambda df: getattr(df, name)(expr, **kwargs),
        [self._expr],
        requires_partition_by=partitionings.Arbitrary(),
        preserves_partition_by=partitionings.Arbitrary())

    if inplace:
      self._expr = result_expr
    else:
      return frame_base.DeferredFrame.wrap(result_expr)

View on GitHub (pinned to 12126d8942)