# Buggy code
def get_column_names(self, virtual=True, strings=True, hidden=False, regex=None):
    """Return a list of column names

    Example:

    >>> import vaex
    >>> df = vaex.from_scalars(x=1, x2=2, y=3, s='string')
    >>> df['r'] = (df.x**2 + df.y**2)**2
    >>> df.get_column_names()
    ['x', 'x2', 'y', 's', 'r']
    >>> df.get_column_names(virtual=False)
    ['x', 'x2', 'y', 's']
    >>> df.get_column_names(regex='x.*')
    ['x', 'x2']

    :param virtual: If False, skip virtual columns
    :param hidden: If False, skip hidden columns
    :param strings: If False, skip string columns
    :param regex: Only return column names matching the (optional) regular expression
    :rtype: list of str

    Example:
    >>> import vaex
    >>> df = vaex.from_scalars(x=1, x2=2, y=3, s='string')
    >>> df['r'] = (df.x**2 + df.y**2)**2
    >>> df.get_column_names()
    ['x', 'x2', 'y', 's', 'r']
    >>> df.get_column_names(virtual=False)
    ['x', 'x2', 'y', 's']
    >>> df.get_column_names(regex='x.*')
    ['x', 'x2']
    """

    def column_filter(name):
        """Return True if column with specified name should be returned"""
        if regex and not re.match(regex, name):
            return False
        if not virtual and name in self.virtual_columns:
            return False
        if not strings and (
            self.dtype(name) == str_type or self.dtype(name).type == np.string_
        ):
            return False
        if not hidden and name.startswith("__"):
            return False
        return True

    if hidden and virtual and regex is None:
        return list(self.column_names)  # quick path
    if not hidden and virtual and regex is None:
        return [
            k for k in self.column_names if not k.startswith("__")
        ]  # also a quick path
    return [name for name in self.column_names if column_filter(name)]


# Traceback (AttributeError)
could not convert column 0, error: TypeError('getattr(): attribute name must be string',), will try to convert it to string
Giving up column 0, error: TypeError('getattr(): attribute name must be string',)
could not convert column 1, error: TypeError('getattr(): attribute name must be string',), will try to convert it to string
Giving up column 1, error: TypeError('getattr(): attribute name must be string',)
could not convert column 2, error: TypeError('getattr(): attribute name must be string',), will try to convert it to string
Giving up column 2, error: TypeError('getattr(): attribute name must be string',)
could not convert column 3, error: TypeError('getattr(): attribute name must be string',), will try to convert it to string
Giving up column 3, error: TypeError('getattr(): attribute name must be string',)
could not convert column 4, error: TypeError('getattr(): attribute name must be string',), will try to convert it to string
Giving up column 4, error: TypeError('getattr(): attribute name must be string',)
could not convert column 5, error: TypeError('getattr(): attribute name must be string',), will try to convert it to string
Giving up column 5, error: TypeError('getattr(): attribute name must be string',)
could not convert column 6, error: TypeError('getattr(): attribute name must be string',), will try to convert it to string
Giving up column 6, error: TypeError('getattr(): attribute name must be string',)
could not convert column 7, error: TypeError('getattr(): attribute name must be string',), will try to convert it to string
Giving up column 7, error: TypeError('getattr(): attribute name must be string',)
could not convert column 8, error: TypeError('getattr(): attribute name must be string',), will try to convert it to string
Giving up column 8, error: TypeError('getattr(): attribute name must be string',)
could not convert column 9, error: TypeError('getattr(): attribute name must be string',), will try to convert it to string
Giving up column 9, error: TypeError('getattr(): attribute name must be string',)
could not convert column 10, error: TypeError('getattr(): attribute name must be string',), will try to convert it to string
Giving up column 10, error: TypeError('getattr(): attribute name must be string',)
could not convert column 11, error: TypeError('getattr(): attribute name must be string',), will try to convert it to string
Giving up column 11, error: TypeError('getattr(): attribute name must be string',)
could not convert column 12, error: TypeError('getattr(): attribute name must be string',), will try to convert it to string
Giving up column 12, error: TypeError('getattr(): attribute name must be string',)
could not convert column 13, error: TypeError('getattr(): attribute name must be string',), will try to convert it to string
Giving up column 13, error: TypeError('getattr(): attribute name must be string',)
could not convert column 14, error: TypeError('getattr(): attribute name must be string',), will try to convert it to string
Giving up column 14, error: TypeError('getattr(): attribute name must be string',)
could not convert column 15, error: TypeError('getattr(): attribute name must be string',), will try to convert it to string
Giving up column 15, error: TypeError('getattr(): attribute name must be string',)
could not convert column 16, error: TypeError('getattr(): attribute name must be string',), will try to convert it to string
Giving up column 16, error: TypeError('getattr(): attribute name must be string',)
could not convert column 17, error: TypeError('getattr(): attribute name must be string',), will try to convert it to string
Giving up column 17, error: TypeError('getattr(): attribute name must be string',)
could not convert column 18, error: TypeError('getattr(): attribute name must be string',), will try to convert it to string
Giving up column 18, error: TypeError('getattr(): attribute name must be string',)
could not convert column 19, error: TypeError('getattr(): attribute name must be string',), will try to convert it to string
Giving up column 19, error: TypeError('getattr(): attribute name must be string',)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/IPython/core/formatters.py in __call__(self, obj, include, exclude)
968                 d['include'] = include
969                 d['exclude'] = exclude
--> 970                 return method(**d)
971             return None
972         else:

5 frames
/usr/local/lib/python3.6/dist-packages/vaex/dataframe.py in column_filter(name)
3486             if not strings and (self.dtype(name) == str_type or self.dtype(name).type == np.string_):
3487                 return False
-> 3488             if not hidden and name.startswith('__'):
3489                 return False
3490             return True

AttributeError: 'int' object has no attribute 'startswith'
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-15-a7b44e392414> in <module>()
3 df = pd.DataFrame(X)
4 df['target'] = y
----> 5 vaex.from_pandas(df)

2 frames
/usr/local/lib/python3.6/dist-packages/IPython/core/formatters.py in format(self, obj, include, exclude)
150             return {}, {}
151
--> 152         format_dict, md_dict = self.mimebundle_formatter(obj, include=include, exclude=exclude)
153
154         if format_dict or md_dict:

TypeError: 'NoneType' object is not iterable

# Fixed code
def get_column_names(
    self, virtual=True, strings=True, hidden=False, regex=None, alias=True
):
    """Return a list of column names

    Example:

    >>> import vaex
    >>> df = vaex.from_scalars(x=1, x2=2, y=3, s='string')
    >>> df['r'] = (df.x**2 + df.y**2)**2
    >>> df.get_column_names()
    ['x', 'x2', 'y', 's', 'r']
    >>> df.get_column_names(virtual=False)
    ['x', 'x2', 'y', 's']
    >>> df.get_column_names(regex='x.*')
    ['x', 'x2']

    :param virtual: If False, skip virtual columns
    :param hidden: If False, skip hidden columns
    :param strings: If False, skip string columns
    :param regex: Only return column names matching the (optional) regular expression
    :param alias: Return the alias (True) or internal name (False).
    :rtype: list of str
    """
    aliases_reverse = (
        {value: key for key, value in self._column_aliases.items()} if alias else {}
    )

    def column_filter(name):
        """Return True if column with specified name should be returned"""
        if regex and not re.match(regex, name):
            return False
        if not virtual and name in self.virtual_columns:
            return False
        if not strings and (
            self.dtype(name) == str_type or self.dtype(name).type == np.string_
        ):
            return False
        if not hidden and name.startswith("__"):
            return False
        return True

    if hidden and virtual and regex is None and not alias:
        return list(self.column_names)  # quick path
    if not hidden and virtual and regex is None and not alias:
        return [
            k for k in self.column_names if not k.startswith("__")
        ]  # also a quick path
    return [
        aliases_reverse.get(name, name)
        for name in self.column_names
        if column_filter(name)
    ]