{"record":{"id":"773d27fa986bb2ae","repo":"apache/beam","slug":"align-s","errorCode":null,"errorMessage":"align(%s)","messagePattern":"align\\((.+?)\\)","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/dataframe/frames.py","lineNumber":2598,"sourceCode":"    Filling NaN values via ``method`` is not supported, because it is\n    `order-sensitive\n    <https://s.apache.org/dataframe-order-sensitive-operations>`_. Only the\n    default, ``method=None``, is allowed.\n\n    ``copy=False`` is not supported because its behavior (whether or not it is\n    an inplace operation) depends on the data.\"\"\"\n    if not copy:\n      raise frame_base.WontImplementError(\n          \"align(copy=False) is not supported because it might be an inplace \"\n          \"operation depending on the data. Please prefer the default \"\n          \"align(copy=True).\")\n    if method is not None and method != lib.no_default:\n      raise frame_base.WontImplementError(\n          f\"align(method={method!r}) is not supported because it is \"\n          \"order sensitive. Only align(method=None) is supported.\",\n          reason=\"order-sensitive\")\n    if kwargs:\n      raise NotImplementedError('align(%s)' % ', '.join(kwargs.keys()))\n\n    # In Pandas 2.0, all aggregations lost the level keyword.\n    if PD_VERSION < (2, 0) and level is not None:\n      # Could probably get by partitioning on the used levels.\n      requires_partition_by = partitionings.Singleton(reason=(\n          f\"align(level={level}) is not currently parallelizable. Only \"\n          \"align(level=None) can be parallelized.\"))\n    elif axis in ('columns', 1):\n      requires_partition_by = partitionings.Arbitrary()\n    else:\n      requires_partition_by = partitionings.Index()\n    return frame_base.DeferredFrame.wrap(\n        expressions.ComputedExpression(\n            'align',\n            lambda df, other: df.align(other, join=join, axis=axis),\n            [self._expr, other._expr],\n            requires_partition_by=requires_partition_by,\n            preserves_partition_by=partitionings.Arbitrary()))","sourceCodeStart":2580,"sourceCodeEnd":2616,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/dataframe/frames.py#L2580-L2616","documentation":"DeferredDataFrame.align supports only the default method=None; any interpolation/fill method (method='pad', 'bfill', etc.) is order-sensitive and cannot be done in Beam's distributed model, raising WontImplementError. Additionally, any extra keyword arguments (other than the pandas signature params consumed above) raise this NotImplementedError listing the offending kwargs.","triggerScenarios":"Calling df1.align(df2, method='pad'); calling align with kwargs not in pandas' signature or not consumed by args_to_kwargs/populate_defaults (e.g. a typo'd parameter like jion='outer').","commonSituations":"Porting pandas align() calls that used fill methods on misaligned indexes; typo'd keyword arguments silently landing in **kwargs; pandas version differences where parameters moved into kwargs.","solutions":["Drop the method argument or set method=None and handle filling explicitly afterwards (e.g. reindex then fillna).","Fix typo'd kwargs; check the exact pandas signature for your pandas version.","Perform alignment before converting to Beam DataFrames (on plain pandas).","Implement alignment via join/merge on the index instead of align()."],"exampleFix":"// before\nl, r = df1.align(df2, method='pad')\n// after\nl, r = df1.align(df2)\nl = l.fillna(method='pad')  # if filling is needed, do it explicitly or in pandas","handlingStrategy":"validation","validationCode":"if method not in (None, lib.no_default):\n    raise ValueError('align(method=...) is unsupported in Beam DataFrames')\n# also ensure no stray kwargs are passed","typeGuard":null,"tryCatchPattern":"try:\n    l, r = df1.align(df2, **extra)\nexcept NotImplementedError as e:\n    logger.error('align rejected kwargs: %s', e.args[0])\n    l, r = df1.align(df2)","preventionTips":["Only call align() with default method=None.","Double-check kwarg spellings; typos fall into **kwargs and raise.","Handle fill/interpolation explicitly after alignment.","Consult the pandas signature for your installed pandas version."],"tags":["python","apache-beam","dataframe","align","order-sensitive"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}