{"record":{"id":"7484a571bd5431c6","repo":"apache/beam","slug":"append-only-accepts-deferreddataframe-instances-received","errorCode":null,"errorMessage":"append() only accepts DeferredDataFrame instances, received {type(other)}","messagePattern":"append\\(\\) only accepts DeferredDataFrame instances, received (.+?)","errorType":"exception","errorClass":"WontImplementError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/dataframe/frames.py","lineNumber":2632,"sourceCode":"            [self._expr, other._expr],\n            requires_partition_by=requires_partition_by,\n            preserves_partition_by=partitionings.Arbitrary()))\n\n  @frame_base.with_docs_from(pd.DataFrame, removed_method=PD_VERSION >= (2, 0))\n  @frame_base.args_to_kwargs(pd.DataFrame, removed_method=PD_VERSION >= (2, 0))\n  @frame_base.populate_defaults(pd.DataFrame,\n                                removed_method=PD_VERSION >= (2, 0))\n  def append(self, other, ignore_index, verify_integrity, sort, **kwargs):\n    \"\"\"``ignore_index=True`` is not supported, because it requires generating an\n    order-sensitive index.\"\"\"\n    if PD_VERSION >= (2, 0):\n      raise frame_base.WontImplementError('append() was removed in Pandas 2.0.')\n    if not isinstance(other, DeferredDataFrame):\n      raise frame_base.WontImplementError(\n          \"append() only accepts DeferredDataFrame instances, received \" +\n          str(type(other)))\n    if ignore_index:\n      raise frame_base.WontImplementError(\n          \"append(ignore_index=True) is order sensitive because it requires \"\n          \"generating a new index based on the order of the data.\",\n          reason=\"order-sensitive\")\n\n    if verify_integrity:\n      # We can verify the index is non-unique within index partitioned data.\n      requires = partitionings.Index()\n    else:\n      requires = partitionings.Arbitrary()\n\n    return frame_base.DeferredFrame.wrap(\n        expressions.ComputedExpression(\n            'append',\n            lambda s, other: s.append(other, sort=sort,\n                                      verify_integrity=verify_integrity,\n                                      **kwargs),\n            [self._expr, other._expr],\n            requires_partition_by=requires,","sourceCodeStart":2614,"sourceCodeEnd":2650,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/dataframe/frames.py#L2614-L2650","documentation":"DeferredDataFrame.append only accepts another DeferredDataFrame as `other`; passing any other object (plain pd.DataFrame, pd.Series, dict, list) raises a WontImplementError. Beam cannot align eager pandas objects with distributed deferred data without order-sensitive operations.","triggerScenarios":"Calling `ddf.append(pd.DataFrame(...))` or `ddf.append(some_series_or_dict)` where `other` is not a DeferredDataFrame instance.","commonSituations":"Mixing a plain pandas DataFrame loaded in driver memory with a Beam deferred DataFrame, e.g. appending a small lookup table to a streaming/distributed frame.","solutions":["Wrap the eager pandas object first: other = apache_beam.dataframe.frames.DeferredFrame.wrap(other) or convert it to a DeferredDataFrame.","Combine the data upstream (in plain pandas) before creating the deferred frame.","Perform the append inside a Apply/Map stage where the data is eager."],"exampleFix":"// before\nddf.append(pd_df)\n\n// after\nfrom apache_beam.dataframe.frame_base import DeferredFrame\nddf.append(DeferredFrame.wrap(pd_df))","handlingStrategy":"type-guard","validationCode":"from apache_beam.dataframe.frame_base import DeferredFrame\nif not isinstance(other, DeferredFrame):\n    other = DeferredFrame.wrap(other)","typeGuard":"def is_deferred_frame(x) -> bool:\n    from apache_beam.dataframe.frame_base import DeferredFrame\n    return isinstance(x, DeferredFrame)","tryCatchPattern":"from apache_beam.dataframe import frame_base\ntry:\n    ddf = ddf.append(other)\nexcept frame_base.WontImplementError:\n    ddf = ddf.append(DeferredFrame.wrap(other))","preventionTips":["Wrap every eager pandas object with DeferredFrame.wrap before mixing with deferred frames.","Keep eager and distributed data separate in the pipeline design.","Add assertions on argument types in helper functions."],"tags":["pandas","apache-beam","dataframe","type-mismatch"],"backgroundTag":"type-mismatch","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}