apache/beam · error · WontImplementError
Unsupported value for new column
Error message
Unsupported value for new column '{name}': '{value}'. Only callables and DeferredSeries instances are supported. Other types make this operation sensitive to the order of the data What it means
DeferredDataFrame.assign rejects column values that are neither callables nor DeferredSeries. Scalars, lists, or plain pandas Series passed as a new column value would need to be broadcast positionally, which depends on the order of rows in the distributed data, so Beam raises WontImplementError with reason 'order-sensitive'.
Solutions
- Pass a callable: ddf.assign(col=lambda df: <DeferredSeries expression>).
- Wrap array-like values as DeferredSeries first, e.g. via beam.dataframe or DeferredSeries.from_monotonic... (construct from the same pipeline).
- Compute constant columns with an elementwise expression over an existing column, e.g. lambda df: df.existing * 0 + value.
Example fix
// before ddf.assign(total=[1, 2, 3]) // after ddf.assign(total=lambda df: df['other_col'] * 0 + 1) # or any callable returning DeferredSeries
Defensive patterns
Strategy: validation
Validate before calling
for name, value in assign_kwargs.items():
if not callable(value) and not isinstance(value, DeferredSeries):
assign_kwargs[name] = lambda df, v=value: df[ref_col] * 0 + v # or wrap as DeferredSeries Type guard
def is_assignable(value) -> bool:
return callable(value) or isinstance(value, DeferredSeries) Try / catch
from apache_beam.dataframe import frame_base
try:
out = ddf.assign(**kwargs)
except frame_base.WontImplementError as e:
# convert offending columns to callables and retry
out = ddf.assign(**{k: (v if callable(v) or isinstance(v, DeferredSeries) else (lambda df, c=v: df[df.columns[0]] * 0 + c)) for k, v in kwargs.items()}) Prevention
- Always pass callables to assign in Beam DataFrame code.
- Never pass positional lists/Series as assign values in distributed contexts.
- Review ported notebook code for scalar/list assign patterns.
When it happens
Trigger: Calling `ddf.assign(col=<scalar | list | pd.Series | np.ndarray>)` — any kwargs value that is not callable and not a DeferredSeries.
Common situations: Porting `df.assign(total=[1,2,3])` or `df.assign(flag=0)` from a notebook to a Beam DataFrame transform; assigning a plain pandas Series column to a distributed frame.
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
- align(method= ) is not supported because it is order…
- axis must be 'index' when upper and/or lower are a…
- drop_duplicates(ignore_index=False) is not supported…
- drop_duplicates(keep= ) is not supported because it is…
- duplicated(keep= ) is not supported because it is sensitive…
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/dd3952e8a77df3fe.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/python/apache_beam/dataframe/frames.py:2731
@property # type: ignore
@frame_base.with_docs_from(pd.DataFrame)
def axes(self):
return (self.index, self.columns)
@property # type: ignore
@frame_base.with_docs_from(pd.DataFrame)
def dtypes(self):
return self._expr.proxy().dtypes
@frame_base.with_docs_from(pd.DataFrame)
def assign(self, **kwargs):
"""``value`` must be a ``callable`` or :class:`DeferredSeries`. Other types
make this operation order-sensitive."""
for name, value in kwargs.items():
if not callable(value) and not isinstance(value, DeferredSeries):
raise frame_base.WontImplementError(
f"Unsupported value for new column '{name}': '{value}'. Only "
"callables and DeferredSeries instances are supported. Other types "
"make this operation sensitive to the order of the data",
reason="order-sensitive")
return self._elementwise(
lambda df, *args, **kwargs: df.assign(*args, **kwargs),
'assign',
other_kwargs=kwargs)
@frame_base.with_docs_from(pd.DataFrame)
@frame_base.args_to_kwargs(pd.DataFrame)
@frame_base.populate_defaults(pd.DataFrame)
def explode(self, column, ignore_index):
# ignoring the index will not preserve it
preserves = (partitionings.Singleton() if ignore_index
else partitionings.Index())
return frame_base.DeferredFrame.wrap(
expressions.ComputedExpression(View on GitHub (pinned to 12126d8942)