{"record":{"id":"0e0be8c17d271dd8","repo":"pandas-dev/pandas","slug":"limit-must-be-none","errorCode":null,"errorMessage":"limit must be None","messagePattern":"limit must be None","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"pandas/core/arrays/interval.py","lineNumber":904,"sourceCode":"        copy : bool, default True\n            Whether to make a copy of the data before filling. If False, then\n            the original should be modified and no new memory should be allocated.\n            For ExtensionArray subclasses that cannot do this, it is at the\n            author's discretion whether to ignore \"copy=False\" or to raise.\n\n        Returns\n        -------\n        filled : IntervalArray with NA/NaN filled\n        \"\"\"\n        if copy is False:\n            raise NotImplementedError\n        if isinstance(value, dict):\n            raise TypeError(\n                \"ExtensionArray.fillna does not support filling with a dict. \"\n                \"Use Series.fillna instead.\"\n            )\n        if limit is not None:\n            raise ValueError(\"limit must be None\")\n\n        value_left, value_right = self._validate_setitem_value(value)\n\n        left = self.left.fillna(value=value_left)\n        right = self.right.fillna(value=value_right)\n        return self._shallow_copy(left, right)\n\n    def astype(self, dtype, copy: bool = True):\n        \"\"\"\n        Cast to an ExtensionArray or NumPy array with dtype 'dtype'.\n\n        Parameters\n        ----------\n        dtype : str or dtype\n            Typecode or data-type to which the array is cast.\n\n        copy : bool, default True\n            Whether to copy the data, even if not necessary. If False,","sourceCodeStart":886,"sourceCodeEnd":922,"githubUrl":"https://github.com/pandas-dev/pandas/blob/71959b8cb9b2459c16e14b34f28b178ccfe14735/pandas/core/arrays/interval.py#L886-L922","documentation":"Raised as a ValueError by `IntervalArray.fillna` when a `limit` argument is supplied. The method does not implement partial filling (limiting consecutive fills); only full fill is supported. Fires at pandas/core/arrays/interval.py:904.","triggerScenarios":"`ia.fillna(pd.Interval(0,1), limit=2)`, or routing a Series `.fillna(..., limit=N)` call down into the underlying array.","commonSituations":"Copy-pasting numeric fillna patterns that include `limit=`; pipelines that auto-pass `limit` to every fillna.","solutions":["Drop the `limit` argument when calling fillna on the IntervalArray.","If partial fill is needed, use the Series-level API: `s.fillna(value, limit=N)`.","Implement partial fill manually by masking the first N NA positions and assigning."],"exampleFix":"// before\nia.fillna(pd.Interval(0, 1), limit=2)\n// after\nia.fillna(pd.Interval(0, 1))\n// or, for partial fill:\ns = pd.Series(ia)\ns = s.fillna(pd.Interval(0, 1), limit=2)","handlingStrategy":"validation","validationCode":"def fillna_interval(ia, value, limit=None):\n    import pandas as pd\n    if limit is not None:\n        return pd.Series(ia).fillna(value, limit=limit).values\n    return ia.fillna(value)","typeGuard":"def limit_is_none(limit) -> bool:\n    return limit is None","tryCatchPattern":"try:\n    out = ia.fillna(value, limit=limit)\nexcept ValueError as e:\n    if \"limit must be None\" in str(e):\n        out = pd.Series(ia).fillna(value, limit=limit).values\n    else:\n        raise","preventionTips":["Drop limit= when calling IntervalArray.fillna directly.","Route partial fills through Series.fillna.","Document which arrays accept limit and which do not."],"tags":["interval","fillna","limit","extension-array"],"analyzedSha":"71959b8cb9b2459c16e14b34f28b178ccfe14735","analyzedAt":"2026-08-07T01:30:20.476Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}