# Buggy code
def add_suffix(self, suffix):
    """
    Suffix labels with string `suffix`.

    For Series, the row labels are suffixed.
    For DataFrame, the column labels are suffixed.

    Parameters
    ----------
    suffix : str
       The string to add before each label.

    Returns
    -------
    DataFrame
       New DataFrame with updated labels.

    See Also
    --------
    Series.add_prefix: Prefix row labels with string `prefix`.
    Series.add_suffix: Suffix row labels with string `suffix`.
    DataFrame.add_prefix: Prefix column labels with string `prefix`.

    Examples
    --------
    >>> df = ks.DataFrame({'A': [1, 2, 3, 4], 'B': [3, 4, 5, 6]}, columns=['A', 'B'])
    >>> df
       A  B
    0  1  3
    1  2  4
    2  3  5
    3  4  6

    >>> df.add_suffix('_col')
       A_col  B_col
    0      1      3
    1      2      4
    2      3      5
    3      4      6
    """
    assert isinstance(suffix, str)
    data_columns = self._internal.data_columns

    sdf = self._sdf.select(
        self._internal.index_columns
        + [self[name]._scol.alias(name + suffix) for name in data_columns]
    )
    internal = self._internal.copy(
        sdf=sdf, data_columns=[name + suffix for name in data_columns]
    )
    return DataFrame(internal)


# Traceback (KeyError)
df = ks.read_parquet("/mnt/ivan/sample.parquet")
df['a.b']

# KeyError: 'a.b'
# ---------------------------------------------------------------------------
# KeyError                                  Traceback (most recent call last)
# <command-3188040896828876> in <module>()
#       1 df = ks.read_parquet("/mnt/ivan/sample.parquet")
# ----> 2 df['a.b']
#
# /databricks/python/lib/python3.5/site-packages/databricks/koalas/frame.py in __getitem__(self, key)
#     448
#     449     def __getitem__(self, key):
# --> 450         return self._pd_getitem(key)
#     451
#     452     def __setitem__(self, key, value):
#
# /databricks/python/lib/python3.5/site-packages/databricks/koalas/frame.py in _pd_getitem(self, key)
#     427                 return Series(self._sdf.__getitem__(key), self, self._metadata.index_info)
#     428             except AnalysisException:
# --> 429                 raise KeyError(key)
#     430         if np.isscalar(key) or isinstance(key, (tuple, string_types)):
#     431             raise NotImplementedError(key)
#
# KeyError: 'a.b'

# Fixed code
def add_suffix(self, suffix):
    """
    Suffix labels with string `suffix`.

    For Series, the row labels are suffixed.
    For DataFrame, the column labels are suffixed.

    Parameters
    ----------
    suffix : str
       The string to add before each label.

    Returns
    -------
    DataFrame
       New DataFrame with updated labels.

    See Also
    --------
    Series.add_prefix: Prefix row labels with string `prefix`.
    Series.add_suffix: Suffix row labels with string `suffix`.
    DataFrame.add_prefix: Prefix column labels with string `prefix`.

    Examples
    --------
    >>> df = ks.DataFrame({'A': [1, 2, 3, 4], 'B': [3, 4, 5, 6]}, columns=['A', 'B'])
    >>> df
       A  B
    0  1  3
    1  2  4
    2  3  5
    3  4  6

    >>> df.add_suffix('_col')
       A_col  B_col
    0      1      3
    1      2      4
    2      3      5
    3      4      6
    """
    assert isinstance(suffix, str)
    data_columns = self._internal.data_columns

    sdf = self._sdf.select(
        self._internal.index_scols
        + [self._internal.scol_for(name).alias(name + suffix) for name in data_columns]
    )
    internal = self._internal.copy(
        sdf=sdf, data_columns=[name + suffix for name in data_columns]
    )
    return DataFrame(internal)