pathwaycom/pathway · error · ValueError

At least one of the parameters [duration, ratio] should be p

Error message

At least one of the parameters [duration, ratio] should be provided.

What it means

Error "At least one of the parameters [duration, ratio] should be provided." thrown in pathwaycom/pathway.

Source

Thrown at python/pathway/stdlib/temporal/_window.py:625

    ...   pw.this._pw_window_start,
    ...   pw.this._pw_window_end,
    ...   min_t=pw.reducers.min(pw.this.t),
    ...   max_t=pw.reducers.max(pw.this.t),
    ...   count=pw.reducers.count(),
    ... )
    >>> pw.debug.compute_and_print(result, include_id=False)
    _pw_instance | _pw_window_start | _pw_window_end | min_t | max_t | count
    0            | 3                | 13             | 12    | 12    | 1
    0            | 6                | 16             | 12    | 15    | 4
    0            | 9                | 19             | 12    | 17    | 6
    0            | 12               | 22             | 12    | 17    | 6
    0            | 15               | 25             | 15    | 17    | 3
    1            | 3                | 13             | 10    | 11    | 2
    1            | 6                | 16             | 10    | 11    | 2
    1            | 9                | 19             | 10    | 11    | 2
    """
    if duration is None and ratio is None:
        raise ValueError(
            "At least one of the parameters [duration, ratio] should be provided."
        )
    elif duration is not None and ratio is not None:
        raise ValueError("Cannot provide both [duration, ratio] at the same time.")

    return _SlidingWindow(
        duration=duration,
        hop=hop,
        ratio=ratio,
        origin=origin,
    )


@check_arg_types
@trace_user_frame
def tumbling(
    duration: int | float | datetime.timedelta,
    origin: int | float | datetime.datetime | None = None,

View on GitHub (pinned to fa2f74a464)

Solutions

  1. Provide exactly one of duration or ratio.

Example fix

pw.temporal.sliding(duration=timedelta(hours=1))

When it happens

Trigger: Thrown at python/pathway/stdlib/temporal/_window.py:625 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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