# Buggy code
def interpolate(
    self,
    method="linear",
    axis=0,
    limit=None,
    inplace=False,
    limit_direction="forward",
    limit_area=None,
    downcast=None,
    **kwargs,
):
    """
    Interpolate values according to different methods.
    """
    result = self._upsample(None)
    return result.interpolate(
        method=method,
        axis=axis,
        limit=limit,
        inplace=inplace,
        limit_direction=limit_direction,
        limit_area=limit_area,
        downcast=downcast,
        **kwargs,
    )


# Traceback (TypeError)
TypeError                                 Traceback (most recent call last)
~/.cache/pypoetry/virtualenvs/lagps-6BuXYM4Y-py3.8/lib/python3.8/site-packages/pandas/core/groupby/groupby.py in apply(self, func, *args, **kwargs)
735             try:
--> 736                 result = self._python_apply_general(f)
737             except TypeError:

~/.cache/pypoetry/virtualenvs/lagps-6BuXYM4Y-py3.8/lib/python3.8/site-packages/pandas/core/groupby/groupby.py in _python_apply_general(self, f)
751     def _python_apply_general(self, f):
--> 752         keys, values, mutated = self.grouper.apply(f, self._selected_obj, self.axis)
753

~/.cache/pypoetry/virtualenvs/lagps-6BuXYM4Y-py3.8/lib/python3.8/site-packages/pandas/core/groupby/ops.py in apply(self, f, data, axis)
205             group_axes = group.axes
--> 206             res = f(group)
207             if not _is_indexed_like(res, group_axes):

~/.cache/pypoetry/virtualenvs/lagps-6BuXYM4Y-py3.8/lib/python3.8/site-packages/pandas/core/resample.py in func(x)
988
--> 989             return x.apply(f, *args, **kwargs)
990

~/.cache/pypoetry/virtualenvs/lagps-6BuXYM4Y-py3.8/lib/python3.8/site-packages/pandas/core/resample.py in aggregate(self, func, *args, **kwargs)
284             grouper = None
--> 285             result = self._groupby_and_aggregate(how, grouper, *args, **kwargs)
286

~/.cache/pypoetry/virtualenvs/lagps-6BuXYM4Y-py3.8/lib/python3.8/site-packages/pandas/core/resample.py in _groupby_and_aggregate(self, how, grouper, *args, **kwargs)
360             else:
--> 361                 result = grouped.aggregate(how, *args, **kwargs)
362         except DataError:

~/.cache/pypoetry/virtualenvs/lagps-6BuXYM4Y-py3.8/lib/python3.8/site-packages/pandas/core/groupby/generic.py in aggregate(self, func, *args, **kwargs)
923             # nicer error message
--> 924             raise TypeError("Must provide 'func' or tuples of '(column, aggfunc).")
925

TypeError: Must provide 'func' or tuples of '(column, aggfunc).

During handling of the above exception, another exception occurred:

TypeError                                 Traceback (most recent call last)
<ipython-input-15-5d08bff36e4d> in <module>
----> 1 df = df \
2     .set_index("week_starting") \
3         .groupby("volume") \
4             .resample("1D") \
5                 .interpolate(method="linear")

~/.cache/pypoetry/virtualenvs/lagps-6BuXYM4Y-py3.8/lib/python3.8/site-packages/pandas/core/resample.py in interpolate(self, method, axis, limit, inplace, limit_direction, limit_area, downcast, **kwargs)
797         Interpolate values according to different methods.
798         """
--> 799         result = self._upsample(None)
800         return result.interpolate(
801             method=method,

~/.cache/pypoetry/virtualenvs/lagps-6BuXYM4Y-py3.8/lib/python3.8/site-packages/pandas/core/resample.py in _apply(self, f, grouper, *args, **kwargs)
989             return x.apply(f, *args, **kwargs)
990
--> 991         result = self._groupby.apply(func)
992         return self._wrap_result(result)
993

~/.cache/pypoetry/virtualenvs/lagps-6BuXYM4Y-py3.8/lib/python3.8/site-packages/pandas/core/groupby/groupby.py in apply(self, func, *args, **kwargs)
745
746                 with _group_selection_context(self):
--> 747                     return self._python_apply_general(f)
748
749         return result

~/.cache/pypoetry/virtualenvs/lagps-6BuXYM4Y-py3.8/lib/python3.8/site-packages/pandas/core/groupby/groupby.py in _python_apply_general(self, f)
750
751     def _python_apply_general(self, f):
--> 752         keys, values, mutated = self.grouper.apply(f, self._selected_obj, self.axis)
753
754         return self._wrap_applied_output(

~/.cache/pypoetry/virtualenvs/lagps-6BuXYM4Y-py3.8/lib/python3.8/site-packages/pandas/core/groupby/ops.py in apply(self, f, data, axis)
204             # group might be modified
205             group_axes = group.axes
--> 206             res = f(group)
207             if not _is_indexed_like(res, group_axes):
208                 mutated = True

~/.cache/pypoetry/virtualenvs/lagps-6BuXYM4Y-py3.8/lib/python3.8/site-packages/pandas/core/resample.py in func(x)
987                 return getattr(x, f)(**kwargs)
988
--> 989             return x.apply(f, *args, **kwargs)
990
991         result = self._groupby.apply(func)

~/.cache/pypoetry/virtualenvs/lagps-6BuXYM4Y-py3.8/lib/python3.8/site-packages/pandas/core/resample.py in aggregate(self, func, *args, **kwargs)
283             how = func
284             grouper = None
--> 285             result = self._groupby_and_aggregate(how, grouper, *args, **kwargs)
286
287         result = self._apply_loffset(result)

~/.cache/pypoetry/virtualenvs/lagps-6BuXYM4Y-py3.8/lib/python3.8/site-packages/pandas/core/resample.py in _groupby_and_aggregate(self, how, grouper, *args, **kwargs)
359                 result = grouped._aggregate_item_by_item(how, *args, **kwargs)
360             else:
--> 361                 result = grouped.aggregate(how, *args, **kwargs)
362         except DataError:
363             # we have a non-reducing function; try to evaluate

~/.cache/pypoetry/virtualenvs/lagps-6BuXYM4Y-py3.8/lib/python3.8/site-packages/pandas/core/groupby/generic.py in aggregate(self, func, *args, **kwargs)
922         elif func is None:
923             # nicer error message
--> 924             raise TypeError("Must provide 'func' or tuples of '(column, aggfunc).")
925
926         func = _maybe_mangle_lambdas(func)

TypeError: Must provide 'func' or tuples of '(column, aggfunc).

# Fixed code
def interpolate(
    self,
    method="linear",
    axis=0,
    limit=None,
    inplace=False,
    limit_direction="forward",
    limit_area=None,
    downcast=None,
    **kwargs,
):
    """
    Interpolate values according to different methods.
    """
    result = self._upsample("asfreq")
    return result.interpolate(
        method=method,
        axis=axis,
        limit=limit,
        inplace=inplace,
        limit_direction=limit_direction,
        limit_area=limit_area,
        downcast=downcast,
        **kwargs,
    )