{"record":{"id":"417119f9180b9d2b","repo":"pathwaycom/pathway","slug":"table-windowby-received-extra-kwargs-you-probab","errorCode":null,"errorMessage":"Table.windowby() received extra kwargs.\nYou probably want to use Table.windowby(...).reduce(**kwargs) to compute output columns.","messagePattern":"Table\\.windowby\\(\\) received extra kwargs\\.\nYou probably want to use Table\\.windowby\\(\\.\\.\\.\\)\\.reduce\\(\\*\\*kwargs\\) to compute output columns\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/internals/arg_handlers.py","lineNumber":61,"sourceCode":"        \"id\": id,\n        \"sort_by\": sort_by,\n        \"_filter_out_results_of_forgetting\": _filter_out_results_of_forgetting,\n        \"instance\": instance,\n        \"_skip_errors\": _skip_errors,\n        \"_is_window\": _is_window,\n    }\n\n\ndef windowby_handler(\n    self, time_expr, *args, window, behavior=None, instance=None, **kwargs\n):\n    if args:\n        raise ValueError(\n            \"Table.windowby() received extra args.\\n\"\n            + \"It handles grouping only by a single column.\"\n        )\n    if kwargs:\n        raise ValueError(\n            \"Table.windowby() received extra kwargs.\\n\"\n            + \"You probably want to use Table.windowby(...).reduce(**kwargs) to compute output columns.\"\n        )\n    return (self, time_expr), {\n        \"window\": window,\n        \"behavior\": behavior,\n        \"instance\": instance,\n    }\n\n\ndef join_kwargs_handler(*, allow_how: bool, allow_id: bool):\n    def handler(self, other, *on, **kwargs):\n        processed_kwargs = {}\n        if \"how\" in kwargs:\n            how = kwargs.pop(\"how\")\n            processed_kwargs[\"how\"] = how\n            if not allow_how:\n                raise ValueError(","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/internals/arg_handlers.py#L43-L79","documentation":"Table.windowby() takes a fixed keyword set (window, behavior, instance) plus one time expression; it does not compute output columns. Any leftover kwargs are assumed to be intended aggregations, and this ValueError redirects them to the chained .reduce(**kwargs) call. It is the windowed analogue of the groupby extra-kwargs guard.","triggerScenarios":"t.windowby(t.time, window=w, sum=pw.reducers.sum(t.value)); passing how= or axis= style options carried over from pandas resample/rolling APIs.","commonSituations":"Converting pandas df.resample('1min').sum() into one Pathway call; writing a long chained expression and accidentally putting reduce arguments one pair of parentheses too early.","solutions":["Move aggregations into reduce: t.windowby(t.time, window=w).reduce(sum=pw.reducers.sum(t.value)).","Verify only window/behavior/instance kwargs remain on windowby.","Use pw.temporal windows plus reducers.id for passthrough columns in reduce."],"exampleFix":"# before\nt.windowby(t.time, window=pw.temporal.tumbling(duration=timedelta(minutes=5)), total=pw.reducers.sum(t.v))\n\n# after\nt.windowby(t.time, window=pw.temporal.tumbling(duration=timedelta(minutes=5))).reduce(\n    total=pw.reducers.sum(t.v)\n)","handlingStrategy":"validation","validationCode":"allowed = {\"window\", \"behavior\", \"instance\"}\nunknown = set(kwargs) - allowed\nif unknown:\n    raise TypeError(f\"pass {unknown} to .reduce() chained after windowby\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Follow the pattern windowby(...).reduce(...) — aggregations never go on windowby.","Only window, behavior, instance are legal kwargs of windowby."],"tags":["windowby","reduce","api-misuse","pandas"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}