{"record":{"id":"08ff6b53d9337f50","repo":"pathwaycom/pathway","slug":"cannot-provide-both-duration-ratio-at-the-same","errorCode":null,"errorMessage":"Cannot provide both [duration, ratio] at the same time.","messagePattern":"Cannot provide both \\[duration, ratio\\] at the same time\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/stdlib/temporal/_window.py","lineNumber":629,"sourceCode":"    ...   count=pw.reducers.count(),\n    ... )\n    >>> pw.debug.compute_and_print(result, include_id=False)\n    _pw_instance | _pw_window_start | _pw_window_end | min_t | max_t | count\n    0            | 3                | 13             | 12    | 12    | 1\n    0            | 6                | 16             | 12    | 15    | 4\n    0            | 9                | 19             | 12    | 17    | 6\n    0            | 12               | 22             | 12    | 17    | 6\n    0            | 15               | 25             | 15    | 17    | 3\n    1            | 3                | 13             | 10    | 11    | 2\n    1            | 6                | 16             | 10    | 11    | 2\n    1            | 9                | 19             | 10    | 11    | 2\n    \"\"\"\n    if duration is None and ratio is None:\n        raise ValueError(\n            \"At least one of the parameters [duration, ratio] should be provided.\"\n        )\n    elif duration is not None and ratio is not None:\n        raise ValueError(\"Cannot provide both [duration, ratio] at the same time.\")\n\n    return _SlidingWindow(\n        duration=duration,\n        hop=hop,\n        ratio=ratio,\n        origin=origin,\n    )\n\n\n@check_arg_types\n@trace_user_frame\ndef tumbling(\n    duration: int | float | datetime.timedelta,\n    origin: int | float | datetime.datetime | None = None,\n) -> Window:\n    \"\"\"Allows grouping together elements within a window of a given length tumbling\n    across ordered time-like data column starting from a given origin.\n","sourceCodeStart":611,"sourceCodeEnd":647,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/stdlib/temporal/_window.py#L611-L647","documentation":"Error \"Cannot provide both [duration, ratio] at the same time.\" thrown in pathwaycom/pathway.","triggerScenarios":"Thrown at python/pathway/stdlib/temporal/_window.py:629 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide only one of duration or ratio, not both."],"exampleFix":"pw.temporal.sliding(duration=timedelta(hours=1))","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}