{"record":{"id":"8d52462b769f52f2","repo":"perspective-dev/perspective","slug":"index-and-limit-cannot-be-set-at-the-same-time","errorCode":null,"errorMessage":"Index and Limit cannot be set at the same time!","messagePattern":"Index and Limit cannot be set at the same time!","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"rust/perspective-python/perspective/widget/__init__.py","lineNumber":181,"sourceCode":"\n        # Examples\n\n        >>> widget = PerspectiveWidget(\n        ...     {\"a\": [1, 2, 3]},\n        ...     aggregates={\"a\": \"avg\"},\n        ...     group_by=[\"a\"],\n        ...     sort=[[\"b\", \"desc\"]],\n        ...     filter=[[\"a\", \">\", 1]],\n        ...     expressions=[\"\\\"a\\\" + 100\"])\n        \"\"\"\n\n        self.binding_mode = binding_mode\n\n        # Pass table load options to the front-end, unless in server mode\n        self._options = {}\n\n        if index is not None and limit is not None:\n            raise TypeError(\"Index and Limit cannot be set at the same time!\")\n\n        # Parse the dataset we pass in - if it's Pandas, preserve pivots\n        # if isinstance(data, pandas.DataFrame) or isinstance(data, pandas.Series):\n        #     data, config = deconstruct_pandas(data)\n\n        #     if config.get(\"group_by\", None) and \"group_by\" not in kwargs:\n        #         kwargs.update({\"group_by\": config[\"group_by\"]})\n\n        #     if config.get(\"split_by\", None) and \"split_by\" not in kwargs:\n        #         kwargs.update({\"split_by\": config[\"split_by\"]})\n\n        #     if config.get(\"columns\", None) and \"columns\" not in kwargs:\n        #         kwargs.update({\"columns\": config[\"columns\"]})\n\n        # Initialize the viewer\n        super(PerspectiveWidget, self).__init__(**kwargs)\n\n        # Handle messages from the the front end","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/perspective-dev/perspective/blob/11c8238c0c9c0b9e490b5a6a2dc277afad1e980a/rust/perspective-python/perspective/widget/__init__.py#L163-L199","documentation":"PerspectiveWidget.__init__ accepts mutually exclusive windowing options: `index` (window from a row offset) and `limit` (window of N rows). Passing both is ambiguous — the table cannot apply two windowing strategies — so construction is rejected before the table is loaded.","triggerScenarios":"Thrown at rust/perspective-python/perspective/widget/__init__.py:181 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass only one of index or limit, not both","Choose limit for a fixed-size recent-rows window, index for streaming from an offset","Set the other option to None (its default)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"11c8238c0c9c0b9e490b5a6a2dc277afad1e980a","analyzedAt":"2026-09-09T00:35:19.377Z","contentChangedAt":"2026-09-09T00:35:19.377Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}