# Buggy code
def plot_rug(self, height, expand_margins, legend, **kws):
    for (
        sub_vars,
        sub_data,
    ) in self.iter_data():
        ax = self._get_axes(sub_vars)

        kws.setdefault("linewidth", 1)

        if expand_margins:
            xmarg, ymarg = ax.margins()
            if "x" in self.variables:
                ymarg += height * 2
            if "y" in self.variables:
                xmarg += height * 2
            ax.margins(x=xmarg, y=ymarg)

        if "hue" in self.variables:
            kws.pop("c", None)
            kws.pop("color", None)

        if "x" in self.variables:
            self._plot_single_rug(sub_data, "x", height, ax, kws)
        if "y" in self.variables:
            self._plot_single_rug(sub_data, "y", height, ax, kws)

        # --- Finalize the plot
        self._add_axis_labels(ax)
        if "hue" in self.variables and legend:
            # TODO ideally i'd like the legend artist to look like a rug
            legend_artist = partial(mpl.lines.Line2D, [], [])
            self._add_legend(
                ax,
                legend_artist,
                False,
                False,
                None,
                1,
                {},
                {},
            )


# Traceback (TypeError)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-12-0cb72350e3e6> in <module>
1 #sns.rugplot()
----> 2 sns.rugplot(x=np.arange("2015-01-01", "2020-01-01", dtype="datetime64[m]"))

~/code/seaborn/seaborn/_decorators.py in inner_f(*args, **kwargs)
44             )
45         kwargs.update({k: arg for k, arg in zip(sig.parameters, args)})
---> 46         return f(**kwargs)
47     return inner_f
48

~/code/seaborn/seaborn/distributions.py in rugplot(x, height, axis, ax, data, y, hue, palette, hue_order, hue_norm, expand_margins, legend, a, **kwargs)
2048         return ax
2049
-> 2050     p.plot_rug(height, expand_margins, legend, **kwargs)
2051
2052     return ax

~/code/seaborn/seaborn/distributions.py in plot_rug(self, height, expand_margins, legend, **kws)
1266
1267             if "x" in self.variables:
-> 1268                 self._plot_single_rug(sub_data, "x", height, ax, kws)
1269             if "y" in self.variables:
1270                 self._plot_single_rug(sub_data, "y", height, ax, kws)

~/code/seaborn/seaborn/distributions.py in _plot_single_rug(self, sub_data, var, height, ax, kws)
1294
1295             trans = tx.blended_transform_factory(ax.transData, ax.transAxes)
-> 1296             xy_pairs = np.column_stack([
1297                 np.repeat(vector, 2), np.tile([0, height], n)
1298             ])

<__array_function__ internals> in column_stack(*args, **kwargs)

~/miniconda3/envs/seaborn-py38-latest/lib/python3.8/site-packages/numpy/lib/shape_base.py in column_stack(tup)
654             arr = array(arr, copy=False, subok=True, ndmin=2).T
655         arrays.append(arr)
--> 656     return _nx.concatenate(arrays, 1)
657
658

<__array_function__ internals> in concatenate(*args, **kwargs)

TypeError: invalid type promotion

# Fixed code
def plot_rug(self, height, expand_margins, legend, **kws):
    for (
        sub_vars,
        sub_data,
    ) in self.iter_data(from_comp_data=True):
        ax = self._get_axes(sub_vars)

        kws.setdefault("linewidth", 1)

        if expand_margins:
            xmarg, ymarg = ax.margins()
            if "x" in self.variables:
                ymarg += height * 2
            if "y" in self.variables:
                xmarg += height * 2
            ax.margins(x=xmarg, y=ymarg)

        if "hue" in self.variables:
            kws.pop("c", None)
            kws.pop("color", None)

        if "x" in self.variables:
            self._plot_single_rug(sub_data, "x", height, ax, kws)
        if "y" in self.variables:
            self._plot_single_rug(sub_data, "y", height, ax, kws)

        # --- Finalize the plot
        self._add_axis_labels(ax)
        if "hue" in self.variables and legend:
            # TODO ideally i'd like the legend artist to look like a rug
            legend_artist = partial(mpl.lines.Line2D, [], [])
            self._add_legend(
                ax,
                legend_artist,
                False,
                False,
                None,
                1,
                {},
                {},
            )