pathwaycom/pathway · error · ValueError

Received `id` argument of join that is a string. Did you mea

Error message

Received `id` argument of join that is a string.
Did you mean <table>.{id} instead of {repr(id)}?

What it means

Where a join accepts 'id', it must be a ColumnReference (e.g. t.id), not the column's name as a string. Passing id='id' is the classic slip this guard catches, and the message helpfully suggests the attribute access you probably meant (<table>.<name>). The check runs in the shared join kwargs handler after the string is popped from kwargs.

Source

Thrown at python/pathway/internals/arg_handlers.py:109

                )
            else:
                raise ValueError(
                    "How argument of join should be one of "
                    + "JoinMode.INNER, JoinMode.LEFT, JoinMode.RIGHT or JoinMode.OUTER values."
                )

        if "id" in kwargs:
            id = kwargs.pop("id")
            processed_kwargs["id"] = id
            if not allow_id:
                raise ValueError(
                    "Received `id` argument but was not expecting any.\n"
                    + "Not every join type supports `id` argument."
                )
            elif id is None:
                pass
            elif isinstance(id, str):
                raise ValueError(
                    "Received `id` argument of join that is a string.\n"
                    + f"Did you mean <table>.{id}"
                    + f" instead of {repr(id)}?"
                )
            elif not isinstance(id, expr.ColumnReference):
                raise ValueError(
                    "The id argument of a join has to be a ColumnReference."
                )

        if "defaults" in kwargs:
            processed_kwargs["defaults"] = kwargs.pop("defaults")

        if "left_instance" in kwargs and "right_instance" in kwargs:
            processed_kwargs["left_instance"] = kwargs.pop("left_instance")
            processed_kwargs["right_instance"] = kwargs.pop("right_instance")
        elif "left_instance" in kwargs or "right_instance" in kwargs:
            raise ValueError(
                "`left_instance` and `right_instance` arguments to join "

View on GitHub (pinned to fa2f74a464)

Solutions

  1. Pass the reference: id=t1.id (whichever table's identity you want).
  2. If the column name is dynamic, use operator.attrgetter or getattr(table, name).
  3. Do not quote the attribute in examples copied from docs.

Example fix

# before
t1.join_any(t2, t1.k == t2.k, id="id")

# after
t1.join_any(t2, t1.k == t2.k, id=t1.id)
Defensive patterns

Strategy: type-guard

Validate before calling

import pathway as pw

id_value = getattr(t1, "id")  # ColumnReference built from the table, not a name string
assert isinstance(id_value, pw.ColumnReference)

Type guard

import pathway as pw

def is_column_reference(v) -> bool:
    return isinstance(v, pw.ColumnReference)

Prevention

When it happens

Trigger: t1.join_any(t2, t1.k == t2.k, id='id'); id='left_id'; id built by f-string from a column name variable.

Common situations: Config-driven code where the id column arrives as its name; autocomplete choosing the string form; examples from other libraries where ids are strings.

Related errors


AI-assisted analysis of pathwaycom/pathway@fa2f74a464 (2026-08-15). Data as JSON: /api/errors/d906439da485b0ae. Report an issue: GitHub.