# Buggy code
def map(self, arg, na_action=None):
    """
    Map values of Series using input correspondence (which can be
    a dict, Series, or function)

    Parameters
    ----------
    arg : function, dict, or Series
    na_action : {None, 'ignore'}
        If 'ignore', propagate NA values

    Examples
    --------
    >>> x
    one   1
    two   2
    three 3

    >>> y
    1  foo
    2  bar
    3  baz

    >>> x.map(y)
    one   foo
    two   bar
    three baz

    Returns
    -------
    y : Series
        same index as caller
    """
    values = self.asobject

    if na_action == "ignore":
        mask = isnull(values)

        def map_f(values, f):
            return lib.map_infer_mask(values, f, mask.view(np.uint8))
    else:
        map_f = lib.map_infer

    if isinstance(arg, (dict, Series)):
        if isinstance(arg, dict):
            arg = self._constructor(arg, index=arg.keys())

        indexer = arg.index.get_indexer(values)
        new_values = algos.take_1d(arg._values, indexer)
        return self._constructor(new_values, index=self.index).__finalize__(self)
    else:
        mapped = map_f(values, arg)
        return self._constructor(mapped, index=self.index).__finalize__(self)


# Traceback (TypeError)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-13-ba941613799a> in <module>()
----> 1 df.publication_timestamp.map(lambda x: x)

/Users/johria/.pyenv/versions/3.5.1/lib/python3.5/site-packages/pandas/core/series.py in map(self, arg, na_action)
2052                                      index=self.index).__finalize__(self)
2053         else:
-> 2054             mapped = map_f(values, arg)
2055             return self._constructor(mapped,
2056                                      index=self.index).__finalize__(self)

TypeError: Argument 'arr' has incorrect type (expected numpy.ndarray, got DatetimeIndex)

# Fixed code
def map(self, arg, na_action=None):
    """
    Map values of Series using input correspondence (which can be
    a dict, Series, or function)

    Parameters
    ----------
    arg : function, dict, or Series
    na_action : {None, 'ignore'}
        If 'ignore', propagate NA values

    Examples
    --------
    >>> x
    one   1
    two   2
    three 3

    >>> y
    1  foo
    2  bar
    3  baz

    >>> x.map(y)
    one   foo
    two   bar
    three baz

    Returns
    -------
    y : Series
        same index as caller
    """

    if is_extension_type(self.dtype):
        values = self._values
        if na_action is not None:
            raise NotImplementedError
        map_f = lambda values, f: values.map(f)
    else:
        values = self.asobject

        if na_action == "ignore":

            def map_f(values, f):
                return lib.map_infer_mask(values, f, isnull(values).view(np.uint8))
        else:
            map_f = lib.map_infer

    if isinstance(arg, (dict, Series)):
        if isinstance(arg, dict):
            arg = self._constructor(arg, index=arg.keys())

        indexer = arg.index.get_indexer(values)
        new_values = algos.take_1d(arg._values, indexer)
    else:
        new_values = map_f(values, arg)

    return self._constructor(new_values, index=self.index).__finalize__(self)