# Buggy code
def _convert_slice_indexer(self, key: slice, kind: str_t):
    """
    Convert a slice indexer.

    By definition, these are labels unless 'iloc' is passed in.
    Floats are not allowed as the start, step, or stop of the slice.

    Parameters
    ----------
    key : label of the slice bound
    kind : {'loc', 'getitem'}
    """
    assert kind in ["loc", "getitem"], kind

    # potentially cast the bounds to integers
    start, stop, step = key.start, key.stop, key.step

    # figure out if this is a positional indexer
    def is_int(v):
        return v is None or is_integer(v)

    is_index_slice = is_int(start) and is_int(stop) and is_int(step)
    is_positional = is_index_slice and not (self.is_integer() or self.is_categorical())

    if kind == "getitem":
        """
            called from the getitem slicers, validate that we are in fact
            integers
            """
        if self.is_integer() or is_index_slice:
            self._validate_indexer("slice", key.start, "getitem")
            self._validate_indexer("slice", key.stop, "getitem")
            self._validate_indexer("slice", key.step, "getitem")
            return key

    # convert the slice to an indexer here

    # if we are mixed and have integers
    if is_positional and self.is_mixed():
        try:
            # Validate start & stop
            if start is not None:
                self.get_loc(start)
            if stop is not None:
                self.get_loc(stop)
            is_positional = False
        except KeyError:
            pass

    if com.is_null_slice(key):
        indexer = key
    elif is_positional:
        indexer = key
    else:
        indexer = self.slice_indexer(start, stop, step, kind=kind)

    return indexer


# Traceback (TypeError)
In [2]: df = pd.DataFrame(-1, index=['i', 'ii', 'iii'], columns=pd.MultiIndex.from_tuples([['A', 'a'], ['B', 'b']]))

In [3]: df.loc[1:, 'A'] = ''

In [4]: df
Out[4]:
A  B
a  b
i    -1 -1
ii      -1
iii     -1

In [5]: df.loc[1:, 'A']
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-98b6153a5b09> in <module>()
----> 1 df.loc[1:, 'A']

/home/pietro/nobackup/repo/pandas/pandas/core/indexing.py in __getitem__(self, key)
1322             except (KeyError, IndexError):
948
949         # we maybe be using a tuple to represent multiple dimensions here

/home/pietro/nobackup/repo/pandas/pandas/core/indexing.py in _getitem_nested_tuple(self, tup)
1020
1021             current_ndim = obj.ndim
-> 1022             obj = getattr(obj, self.name)._getitem_axis(key, axis=axis)
1023             axis += 1
1024

/home/pietro/nobackup/repo/pandas/pandas/core/indexing.py in _getitem_axis(self, key, axis)
1503         if isinstance(key, slice):
1504             self._has_valid_type(key, axis)
-> 1505             return self._get_slice_axis(key, axis=axis)
1506         elif is_bool_indexer(key):
1507             return self._getbool_axis(key, axis=axis)

/home/pietro/nobackup/repo/pandas/pandas/core/indexing.py in _get_slice_axis(self, slice_obj, axis)
1353         labels = obj._get_axis(axis)
1354         indexer = labels.slice_indexer(slice_obj.start, slice_obj.stop,
-> 1355                                        slice_obj.step, kind=self.name)
1356
1357         if isinstance(indexer, slice):

/home/pietro/nobackup/repo/pandas/pandas/indexes/base.py in slice_indexer(self, start, end, step, kind)
3247         """
3248         start_slice, end_slice = self.slice_locs(start, end, step=step,
-> 3249                                                  kind=kind)
3250
3251         # return a slice

/home/pietro/nobackup/repo/pandas/pandas/indexes/base.py in slice_locs(self, start, end, step, kind)
3428         start_slice = None
3429         if start is not None:
-> 3430             start_slice = self.get_slice_bound(start, 'left', kind)
3431         if start_slice is None:
3432             start_slice = 0

/home/pietro/nobackup/repo/pandas/pandas/indexes/base.py in get_slice_bound(self, label, side, kind)
3367         # For datetime indices label may be a string that has to be converted
3368         # to datetime boundary according to its resolution.
-> 3369         label = self._maybe_cast_slice_bound(label, side, kind)
3370
3371         # we need to look up the label

/home/pietro/nobackup/repo/pandas/pandas/indexes/base.py in _maybe_cast_slice_bound(self, label, side, kind)
3325         # this is rejected (generally .loc gets you here)
3326         elif is_integer(label):
-> 3327             self._invalid_indexer('slice', label)
3328
3329         return label

/home/pietro/nobackup/repo/pandas/pandas/indexes/base.py in _invalid_indexer(self, form, key)
1447                         "indexers [{key}] of {kind}".format(
1448                             form=form, klass=type(self), key=key,
-> 1449                             kind=type(key)))
1450
1451     def get_duplicates(self):

TypeError: cannot do slice indexing on <class 'pandas.indexes.base.Index'> with these indexers [1] of <class 'int'>

# Fixed code
def _convert_slice_indexer(self, key: slice, kind: str_t):
    """
    Convert a slice indexer.

    By definition, these are labels unless 'iloc' is passed in.
    Floats are not allowed as the start, step, or stop of the slice.

    Parameters
    ----------
    key : label of the slice bound
    kind : {'loc', 'getitem'}
    """
    assert kind in ["loc", "getitem"], kind

    # potentially cast the bounds to integers
    start, stop, step = key.start, key.stop, key.step

    # figure out if this is a positional indexer
    def is_int(v):
        return v is None or is_integer(v)

    is_index_slice = is_int(start) and is_int(stop) and is_int(step)
    is_positional = is_index_slice and not (self.is_integer() or self.is_categorical())

    if kind == "getitem":
        """
            called from the getitem slicers, validate that we are in fact
            integers
            """
        if self.is_integer() or is_index_slice:
            self._validate_indexer("slice", key.start, "getitem")
            self._validate_indexer("slice", key.stop, "getitem")
            self._validate_indexer("slice", key.step, "getitem")
            return key

    # convert the slice to an indexer here

    # if we are mixed and have integers
    if is_positional and self.is_mixed():
        try:
            # Validate start & stop
            if start is not None:
                self.get_loc(start)
            if stop is not None:
                self.get_loc(stop)
            is_positional = False
        except KeyError:
            pass

    if com.is_null_slice(key):
        # It doesn't matter if we are positional or label based
        indexer = key
    elif is_positional:
        if kind == "loc":
            # GH#16121, GH#24612, GH#31810
            warnings.warn(
                "Slicing a positional slice with .loc is not supported, "
                "and will raise TypeError in a future version.  "
                "Use .loc with labels or .iloc with positions instead.",
                FutureWarning,
                stacklevel=6,
            )
        indexer = key
    else:
        indexer = self.slice_indexer(start, stop, step, kind=kind)

    return indexer