.interpolate() Method Incompatible with float[pyarrow] Dtype · Issue #56267 · pandas-dev/pandas (original) (raw)

the .interpolate() method fails with a TypeError when applied to a Pandas Series with the dtype float[pyarrow].

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[18], line 2
      1 temp = pd.Series([32, 40, None, 42, 39, 32], dtype='float[pyarrow]')
----> 2 temp.interpolate()

File ~/.envs/menv/lib/python3.10/site-packages/pandas/core/generic.py:8206, in NDFrame.interpolate(self, method, axis, limit, inplace, limit_direction, limit_area, downcast, **kwargs)
   8204 else:
   8205     index = missing.get_interp_index(method, obj.index)
-> 8206     new_data = obj._mgr.interpolate(
   8207         method=method,
   8208         index=index,
   8209         limit=limit,
   8210         limit_direction=limit_direction,
   8211         limit_area=limit_area,
   8212         inplace=inplace,
   8213         downcast=downcast,
   8214         **kwargs,
   8215     )
   8217 result = self._constructor_from_mgr(new_data, axes=new_data.axes)
   8218 if should_transpose:

File ~/.envs/menv/lib/python3.10/site-packages/pandas/core/internals/base.py:265, in DataManager.interpolate(self, inplace, **kwargs)
    264 def interpolate(self, inplace: bool, **kwargs) -> Self:
--> 265     return self.apply_with_block(
    266         "interpolate", inplace=inplace, **kwargs, using_cow=using_copy_on_write()
    267     )

File ~/.envs/menv/lib/python3.10/site-packages/pandas/core/internals/managers.py:354, in BaseBlockManager.apply(self, f, align_keys, **kwargs)
    352         applied = b.apply(f, **kwargs)
    353     else:
--> 354         applied = getattr(b, f)(**kwargs)
    355     result_blocks = extend_blocks(applied, result_blocks)
    357 out = type(self).from_blocks(result_blocks, self.axes)

File ~/.envs/menv/lib/python3.10/site-packages/pandas/core/internals/blocks.py:1507, in Block.interpolate(self, method, index, inplace, limit, limit_direction, limit_area, downcast, using_cow, **kwargs)
   1504 copy, refs = self._get_refs_and_copy(using_cow, inplace)
   1506 # Dispatch to the EA method.
-> 1507 new_values = self.array_values.interpolate(
   1508     method=method,
   1509     axis=self.ndim - 1,
   1510     index=index,
   1511     limit=limit,
   1512     limit_direction=limit_direction,
   1513     limit_area=limit_area,
   1514     copy=copy,
   1515     **kwargs,
   1516 )
   1517 data = extract_array(new_values, extract_numpy=True)
   1519 nb = self.make_block_same_class(data, refs=refs)

TypeError: ExtensionArray.interpolate() missing 1 required keyword-only argument: 'fill_value'

That this would work like it does in Pandas 1.