pathwaycom/pathway · error · ValueError
Only one column from a table can be used in a synchronizatio
Error message
Only one column from a table can be used in a synchronization group
What it means
ValueError raised when the synchronization code finds an InputOperator for the column's table whose data source already has a synchronization_group assigned. Each input table (connector) can contribute at most one column to synchronization groups, because the group is attached to the data source options, not per column.
Source
Thrown at python/pathway/io/_synchronization.py:291
if column_idx is None:
raise ValueError(
f"Failed to find the column '{column._name}' in table {column._table}"
)
is_table_found = False
for node in G._current_scope.nodes:
if (
not isinstance(node, InputOperator)
or not isinstance(node.datasource, GenericDataSource)
or node.outputs[0].value != column._table
):
continue
is_table_found = True
group = api.ConnectorGroupDescriptor(
name, column_idx, max_difference, priority, idle_duration
)
if node.datasource.data_source_options.synchronization_group is not None:
raise ValueError(
"Only one column from a table can be used in a synchronization group"
)
node.datasource.data_source_options.set_synchronization_group(group)
break
if not is_table_found:
raise ValueError(
"Only unchanged columns of an input tables can be used in input synchronization groups"
)
if len(column_types) > 1:
raise ValueError(
"All synchronization group column types must coincide. "
"However several types have been detected: {}".format(
", ".join(sorted([f"'{t}'" for t in column_types]))
)
)
View on GitHub (pinned to fa2f74a464)
Solutions
- Use only one column per table across all synchronization groups; pick the primary timestamp (e.g. unix_timestamp)
- If a second key of the same source must be synchronized, feed that source through a second independent connector/table
- Audit all sync() calls and ensure no table contributes more than one column reference
Example fix
// before pw.io.synchronize(t.created_at, u.time, max_difference=60) pw.io.synchronize(t.updated_at, v.time, max_difference=60) # ValueError: same table twice // after pw.io.synchronize(t.created_at, u.time, v.time, max_difference=60)
Defensive patterns
Strategy: validation
Validate before calling
from collections import Counter
def validate_one_column_per_table(columns) -> None:
tables = Counter(c._table for c in columns)
dupes = [t for t, n in tables.items() if n > 1]
if dupes:
raise ValueError(f'tables used with more than one sync column: {dupes}') Prevention
- Track which tables already joined a sync group in pipeline builders
- Design one timestamp key per connector for synchronization
- Add a lint/test pass asserting each input table appears in at most one group
When it happens
Trigger: Calling sync() twice with different columns of the same table: sync(t.a, u.x, ...) then sync(t.b, v.y, ...); or passing two columns of the same table in one call. The second assignment hits data_source_options.synchronization_group is not None.
Common situations: Trying to synchronize two connectors by two different time keys of the same source (e.g. created_at and updated_at); composing multiple sync groups in a larger pipeline where one table appears twice; refactoring that accidentally duplicates a table's column into another group.
Related errors
- At least two columns must participate in a connector group
- The 'max_difference' must either be an integer or a datetime
- The 'max_difference' can't be negative
- synchronization_group can only be set once
- Failed to find the column '{column._name}' in table {column.
AI-assisted analysis of pathwaycom/pathway@fa2f74a464 (2026-08-15).
Data as JSON: /api/errors/69e0510c0579883f.
Report an issue: GitHub.