# Buggy code
def shift(self, periods, offset=None, timeRule=None):
    """
    Analogous to Series.shift
    """
    # no special handling of fill values yet
    if not isnull(self.fill_value):
        dense_shifted = self.to_dense().shift(periods, offset=offset, timeRule=timeRule)
        return dense_shifted.to_sparse(fill_value=self.fill_value, kind=self.kind)

    if periods == 0:
        return self.copy()

    if timeRule is not None and offset is None:
        offset = datetools.getOffset(timeRule)

    if offset is not None:
        return SparseSeries(
            self.sp_values,
            sparse_index=self.sp_index,
            index=self.index.shift(periods, offset),
            fill_value=self.fill_value,
        )

    int_index = self.sp_index.to_int_index()
    new_indices = int_index.indices + periods
    start, end = new_indices.searchsorted([0, int_index.length])

    new_indices = new_indices[start:end]

    new_sp_index = IntIndex(len(self), new_indices)
    if isinstance(self.sp_index, BlockIndex):
        new_sp_index = new_sp_index.to_block_index()

    return SparseSeries(
        self.sp_values[start:end].copy(),
        index=self.index,
        sparse_index=new_sp_index,
        fill_value=self.fill_value,
    )


# Traceback (ValueError)
In [17]: date_range(datetime.datetime.today(), periods=10, freq='2h20m')
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/home/chang/Dropbox/git/pandas/<ipython-input-17-ff4e03382573> in <module>()
----> 1 date_range(datetime.datetime.today(), periods=10, freq='2h20m')

/home/chang/Dropbox/git/pandas/pandas/tseries/index.pyc in date_range(start, end, periods, freq, tz, normalize)
1209     """
1210     return DatetimeIndex(start=start, end=end, periods=periods,
-> 1211                          freq=freq, tz=tz, normalize=normalize)
1212
1213

/home/chang/Dropbox/git/pandas/pandas/tseries/index.pyc in __new__(cls, data, freq, start, end, periods, copy, name, tz, verify_integrity, normalize, **kwds)
202
203         if data is None and offset is None:
--> 204             raise ValueError("Must provide freq argument if no data is "
205                              "supplied")
206

ValueError: Must provide freq argument if no data is supplied

# Fixed code
def shift(self, periods, freq=None, **kwds):
    """
    Analogous to Series.shift
    """
    from pandas.core.series import _resolve_offset

    offset = _resolve_offset(freq, kwds)

    # no special handling of fill values yet
    if not isnull(self.fill_value):
        dense_shifted = self.to_dense().shift(periods, freq=freq, **kwds)
        return dense_shifted.to_sparse(fill_value=self.fill_value, kind=self.kind)

    if periods == 0:
        return self.copy()

    if offset is not None:
        return SparseSeries(
            self.sp_values,
            sparse_index=self.sp_index,
            index=self.index.shift(periods, offset),
            fill_value=self.fill_value,
        )

    int_index = self.sp_index.to_int_index()
    new_indices = int_index.indices + periods
    start, end = new_indices.searchsorted([0, int_index.length])

    new_indices = new_indices[start:end]

    new_sp_index = IntIndex(len(self), new_indices)
    if isinstance(self.sp_index, BlockIndex):
        new_sp_index = new_sp_index.to_block_index()

    return SparseSeries(
        self.sp_values[start:end].copy(),
        index=self.index,
        sparse_index=new_sp_index,
        fill_value=self.fill_value,
    )