pathwaycom/pathway · error · ValueError

The interval argument of a join should be of a type pathway.

Error message

The interval argument of a join should be of a type pathway.temporal.Interval.

What it means

The join argument preprocessor validates the `interval` kwarg for interval joins. It must be an instance of `pathway.stdlib.temporal.Interval` (e.g. `pw.temporal.interval(ms)`), which defines the join window tolerance. Passing a raw number (int/float/pandas.Timedelta) is rejected.

Source

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

                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")

        if kwargs:
            raise ValueError(
                "Join received extra kwargs.\n"
                + "You probably want to use TableLike.join(...).select(**kwargs) to compute output columns."
            )
        return (self, other, *on), processed_kwargs

    return handler

View on GitHub (pinned to fa2f74a464)

Solutions

  1. Wrap the value: interval=pw.temporal.interval(ms=5000) (or us=..., s=..., minutes=... as supported).
  2. Convert pd.Timedelta via its total milliseconds into pw.temporal.interval(ms=...).
  3. Remove `interval` if you intended an as-of join and meant `behavior` instead.

Example fix

# before
t.join(right, left_time=lt, right_time=rt, interval=5000)

# after
import pathway as pw
t.join(right, left_time=lt, right_time=rt, interval=pw.temporal.interval(ms=5000))
Defensive patterns

Strategy: type-guard

Validate before calling

from pathway.stdlib.temporal import Interval
assert interval is None or isinstance(interval, Interval)

Type guard

from pathway.stdlib.temporal import Interval

def is_valid_interval(i) -> bool:
    return i is None or isinstance(i, Interval)

Prevention

When it happens

Trigger: Calling Table.join(..., interval=5000) or interval=pd.Timedelta("5s") instead of interval=pw.temporal.interval(ms=5000).

Common situations: Developers porting SQL BETWEEN-join examples where the tolerance is a plain number; using pandas timedelta objects out of habit; older Pathway versions accepted raw values in interval joins so upgraded code breaks.

Related errors


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