def _auto_fill(series: TimeSeries, **interpolate_kwargs) -> TimeSeries:
    """
    This function fills the missing values in the TimeSeries `series`,
    using the `pandas.Dataframe.interpolate()` method.

    Parameters
    ----------
    series
        The time series
    interpolate_kwargs
        Keyword arguments for `pandas.Dataframe.interpolate()`.
        See `the documentation
        <https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.interpolate.html>`_
        for the list of supported parameters.
    Returns
    -------
    TimeSeries
        A new TimeSeries with all missing values filled according to the rules above.
    """

    series_temp = series.to_dataframe()

    # pandas interpolate wrapper, with chosen `method`
    if "limit_direction" not in interpolate_kwargs:
        interpolate_kwargs["limit_direction"] = "both"
    interpolate_kwargs["inplace"] = True
    series_temp.interpolate(**interpolate_kwargs)
    return TimeSeries.from_dataframe(
        series_temp,
        freq=series.freq,
        static_covariates=series.static_covariates,
        hierarchy=series.hierarchy,
        metadata=series.metadata,
    )

    This function fills the missing values in the TimeSeries `series`,
    using the `pandas.Dataframe.interpolate()` method.

    Parameters
    ----------
    series
        The time series
    interpolate_kwargs
        Keyword arguments for `pandas.Dataframe.interpolate()`.
        See `the documentation
        <https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.interpolate.html>`_
        for the list of supported parameters.
    Returns
    -------
    TimeSeries
        A new TimeSeries with all missing values filled according to the rules above.
    
darts/utils/missing_values.py