apache/beam · error · WontImplementError

align(method={method!r}) is not supported because it is orde

Error message

align(method={method!r}) is not supported because it is order sensitive. Only align(method=None) is supported.

What it means

In apache_beam.dataframe (the pandas-on-Beam API), align() joins two deferred frames on their index. Any align(method=...) other than the default None relies on element order (e.g. 'outer'/'inner' fill ordering), which is not guaranteed in a distributed pipeline, so the library raises WontImplementError with reason 'order-sensitive'. Only align(method=None) (which drops non-matching rows without reordering semantics) is supported.

Source

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

            [self._expr, to_append._expr],
            requires_partition_by=requires,
            preserves_partition_by=partitionings.Arbitrary()))

  @frame_base.with_docs_from(pd.Series)
  @frame_base.args_to_kwargs(pd.Series)
  @frame_base.populate_defaults(pd.Series)
  def align(self, other, join, axis, level, method, **kwargs):
    """Aligning per-level is not yet supported. Only the default,
    ``level=None``, is allowed.

    Filling NaN values via ``method`` is not supported, because it is
    `order-sensitive
    <https://s.apache.org/dataframe-order-sensitive-operations>`_.
    Only the default, ``method=None``, is allowed."""
    if level is not None:
      raise NotImplementedError('per-level align')
    if method is not None and method != lib.no_default:
      raise frame_base.WontImplementError(
          f"align(method={method!r}) is not supported because it is "
          "order sensitive. Only align(method=None) is supported.",
          reason="order-sensitive")
    # We're using pd.concat here as expressions don't yet support
    # multiple return values.
    aligned = frame_base.DeferredFrame.wrap(
        expressions.ComputedExpression(
            'align', lambda x, y: pd.concat([x, y], axis=1, join='inner'),
            [self._expr, other._expr],
            requires_partition_by=partitionings.Index(),
            preserves_partition_by=partitionings.Arbitrary()))
    return aligned.iloc[:, 0], aligned.iloc[:, 1]

  argsort = frame_base.wont_implement_method(
      pd.Series, 'argsort', reason="order-sensitive")

  array = property(
      frame_base.wont_implement_method(

View on GitHub (pinned to 12126d8942)

Solutions

  1. Remove the method argument and call align(other) so method defaults to None
  2. If a specific join type is needed, rewrite as explicit join()/merge() or intersection/union of indexes instead of align(method=...)
  3. If fill_value is needed with a method, align with method=None then fillna/reindex on the combined index explicitly

Example fix

// before
left_aligned, right_aligned = left.align(right, method='inner')
// after
left_aligned, right_aligned = left.align(right)
Defensive patterns

Strategy: validation

Validate before calling

if method is not None and str(method) != '<no_default>':
    raise ValueError('align(method=...) unsupported; use default align(other)')

Type guard

def is_beam_safe_align(kwargs):
    return kwargs.get('method') in (None, getattr(__import__('pandas').lib, 'no_default', None))

Try / catch

from apache_beam.dataframe import frame_base
try:
    l, r = left.align(right)
except frame_base.WontImplementError:
    l, r = left.align(right)  # or rewrite as join/merge

Prevention

When it happens

Trigger: Calling DeferredDataFrame.align(other, method='inner'|'outer'|'left'|'right') or passing any truthy method value; only method=None (the pandas default) is allowed. Also raises NotImplementedError separately if level is not None.

Common situations: Porting pandas code that used align(..., method='inner') or align with fill_value plus a method to control join behavior; refactoring existing Dataframe pipelines to Beam and copying pandas align calls verbatim.

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