pathwaycom/pathway · error · ValueError

The behavior argument of join should be of type pathway.temp

Error message

The behavior argument of join should be of type pathway.temporal.CommonBehavior.

What it means

The join argument preprocessor validates the `behavior` kwarg for temporal (as-of/interval) joins. It must be an instance of `pathway.stdlib.temporal.CommonBehavior` (created via `pw.temporal.common_behavior(...)`), which controls buffering/allowing exact matches. Anything else — including plain dicts or tuples — is rejected eagerly.

Source

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

            from pathway.stdlib.temporal import Direction

            if isinstance(direction, str):
                raise ValueError(
                    "Received `direction` argument of join that is a string.\n"
                    + "You probably want to use one of "
                    + "Direction.BACKWARD, Direction.FORWARD or Direction.NEAREST values."
                )
            if not isinstance(direction, Direction):
                raise ValueError(
                    "direction argument of join should be of type asof_join.Direction."
                )

        if "behavior" in kwargs:
            behavior = processed_kwargs["behavior"] = kwargs.pop("behavior")
            from pathway.stdlib.temporal import CommonBehavior

            if not isinstance(behavior, CommonBehavior):
                raise ValueError(
                    "The behavior argument of join should be of type pathway.temporal.CommonBehavior."
                )

        if "interval" in kwargs:
            from pathway.stdlib.temporal import Interval

            interval = processed_kwargs["interval"] = kwargs.pop("interval")
            if not isinstance(interval, Interval):
                raise ValueError(
                    "The interval argument of a join should be of a type pathway.temporal.Interval."
                )

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

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

View on GitHub (pinned to fa2f74a464)

Solutions

  1. Wrap your parameters: behavior=pw.temporal.common_behavior(closed_cb, allowed_latency) with booleans for exact-match handling.
  2. Remove the `behavior` argument if you do not need buffering semantics.
  3. Check the installed Pathway version's temporal API docs — the tuple form was replaced by CommonBehavior in later releases.

Example fix

# before (old API)
t.join_asof(right, t_left_time, t_right_time, behavior=(100, 500))

# after
import pathway as pw
t.join_asof(right, t_left_time, t_right_time,
           behavior=pw.temporal.common_behavior(closed_cb=False, allowed_latency=500))
Defensive patterns

Strategy: type-guard

Validate before calling

from pathway.stdlib.temporal import CommonBehavior
assert behavior is None or isinstance(behavior, CommonBehavior)

Type guard

from pathway.stdlib.temporal import CommonBehavior

def is_valid_behavior(b) -> bool:
    return b is None or isinstance(b, CommonBehavior)

Prevention

When it happens

Trigger: Passing behavior=(delay, window) as a tuple (an older Pathway API accepted this shape), behavior={"delay": ...}, or any non-CommonBehavior value to Table.join with temporal semantics.

Common situations: Upgrading from old Pathway versions where asof_join accepted `behavior=(delay, horizon)` tuples; converting temporal join examples that mix `behavior` with `interval` and reusing raw tuple parameters.

Related errors


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