{"record":{"id":"d8f1b1bbb16aa82d","repo":"pandas-dev/pandas","slug":"interpolate-is-not-implemented-for-dtype-self-dty","errorCode":null,"errorMessage":"interpolate is not implemented for dtype={self.dtype}","messagePattern":"interpolate is not implemented for dtype=(.+?)","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"pandas/core/arrays/arrow/array.py","lineNumber":3173,"sourceCode":"            method == \"linear\"\n            and limit_area is None\n            and limit is None\n            and limit_direction == \"forward\"\n        ):\n            values = self._pa_array.combine_chunks()\n            na_value = pa.array([None], type=values.type)\n            y_diff_2 = pc.fill_null_backward(pc.pairwise_diff_checked(values, period=2))\n            prev_values = pa.concat_arrays([na_value, values[:-2], na_value])\n            interps = pc.add_checked(prev_values, pc.divide_checked(y_diff_2, 2))\n            return self._from_pyarrow_array(pc.coalesce(self._pa_array, interps))\n\n        mask = self.isna()\n        if self.dtype.kind == \"f\":\n            data = self._pa_array.to_numpy()\n        elif self.dtype.kind in \"iu\":\n            data = self.to_numpy(dtype=\"f8\", na_value=0.0)\n        else:\n            raise NotImplementedError(\n                f\"interpolate is not implemented for dtype={self.dtype}\"\n            )\n\n        missing.interpolate_2d_inplace(\n            data,\n            method=method,\n            axis=0,\n            index=index,\n            limit=limit,\n            limit_direction=limit_direction,\n            limit_area=limit_area,\n            mask=mask,\n            **kwargs,\n        )\n        return self._from_pyarrow_array(self._box_pa_array(pa.array(data, mask=mask)))\n\n    @classmethod\n    def _if_else(","sourceCodeStart":3155,"sourceCodeEnd":3191,"githubUrl":"https://github.com/pandas-dev/pandas/blob/71959b8cb9b2459c16e14b34f28b178ccfe14735/pandas/core/arrays/arrow/array.py#L3155-L3191","documentation":"Raised inside interpolate for numeric-but-not-int-or-float dtypes that don't fit the missing.interpolate_2d_inplace path. Temporal/decimal/etc. numeric-like arrow types that aren't 'f' or 'iu' kinds are not implemented for the general interpolation algorithms.","triggerScenarios":"Calling `Series.interpolate()` on a pyarrow-backed temporal/decimal column with a method other than the supported fast linear path (e.g. `method='index'`, `'pad'`, or with `limit_area`/`limit` set on a timestamp dtype).","commonSituations":"Interpolating timestamp/date/decimal arrow columns with non-linear methods, or with limit/limit_area parameters that bypass the optimized linear branch.","solutions":["Use the supported fast path: `method='linear'`, `limit_direction='forward'`, with no `limit`/`limit_area`.","Cast to a numeric dtype, interpolate, then cast back: `s.astype('int64[pyarrow]').interpolate(...)` for timestamps.","Use `.ffill()`/`.bfill()` as a fallback for temporal columns."],"exampleFix":"// before\ns = pd.Series(pd.to_datetime([\"2020-01-01\", None, \"2020-01-03\"]), dtype=\"timestamp[ns][pyarrow]\")\ns.interpolate(method=\"index\")\n\n// after\ns.interpolate(method=\"linear\", limit_direction=\"forward\")","handlingStrategy":"fallback","validationCode":"def safe_interpolate(s, method=\"linear\", **kw):\n    if getattr(s.dtype, \"kind\", None) not in {\"f\", \"i\", \"u\"}:\n        # only the fast linear path supports other numeric-like dtypes; otherwise cast\n        if method != \"linear\" or kw.get(\"limit_area\") or kw.get(\"limit\") or kw.get(\"limit_direction\") != \"forward\":\n            s = s.astype(\"int64[pyarrow]\") if s.dtype.kind in \"mM\" else s\n    return s.interpolate(method=method, **kw)","typeGuard":"def interpolate_implemented(arr) -> bool:\n    kind = getattr(arr.dtype, \"kind\", None)\n    return kind in {\"f\", \"i\", \"u\"}","tryCatchPattern":"try:\n    s.interpolate(method=method)\nexcept NotImplementedError as e:\n    if \"interpolate is not implemented for dtype\" in str(e):\n        s.astype(\"int64[pyarrow]\").interpolate(method=method)\n    else:\n        raise","preventionTips":["For temporal arrow dtypes prefer method='linear' with limit_direction='forward'.","Cast to int64 ns representation for unsupported interpolation methods on timestamps.","Keep an ffill/bfill fallback for non-float dtypes."],"tags":["arrow","interpolate","not-implemented","temporal"],"analyzedSha":"71959b8cb9b2459c16e14b34f28b178ccfe14735","analyzedAt":"2026-08-07T01:30:20.476Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}