# Buggy code
def _deprecate_positional_args(f):
    """Decorator for methods that issues warnings for positional arguments.

    Using the keyword-only argument syntax in pep 3102, arguments after the
    * will issue a warning when passed as a positional argument.

    Parameters
    ----------
    f : function
        function to check arguments on

    """
    sig = signature(f)
    kwonly_args = []
    all_args = []

    for name, param in sig.parameters.items():
        if param.kind == Parameter.POSITIONAL_OR_KEYWORD:
            all_args.append(name)
        elif param.kind == Parameter.KEYWORD_ONLY:
            kwonly_args.append(name)

    @wraps(f)
    def inner_f(*args, **kwargs):
        extra_args = len(args) - len(all_args)
        if extra_args > 0:
            plural = "s" if extra_args > 1 else ""
            article = "" if plural else "a "
            warnings.warn(
                "Pass the following variable{} as {}keyword arg{}: {}. "
                "From version 0.12, the only valid positional argument "
                "will be `data`, and passing other arguments without an "
                "explcit keyword will result in an error or misinterpretation.".format(
                    plural, article, plural, ", ".join(kwonly_args[:extra_args])
                ),
                FutureWarning,
            )
        kwargs.update({k: arg for k, arg in zip(sig.parameters, args)})
        return f(**kwargs)

    return inner_f


# Traceback (AttributeError)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
AttributeError: 'float' object has no attribute 'rint'

The above exception was the direct cause of the following exception:

TypeError                                 Traceback (most recent call last)
~/miniconda3/envs/seaborn-refactor/lib/python3.8/site-packages/numpy/core/fromnumeric.py in _wrapfunc(obj, method, *args, **kwds)
60     try:
---> 61         return bound(*args, **kwds)
62     except TypeError:

TypeError: loop of ufunc does not support argument 0 of type float which has no callable rint method

During handling of the above exception, another exception occurred:

AttributeError                            Traceback (most recent call last)
AttributeError: 'float' object has no attribute 'rint'

The above exception was the direct cause of the following exception:

TypeError                                 Traceback (most recent call last)
<ipython-input-76-61b464cca20e> in <module>
----> 1 sns.lineplot(x=[0, 1, 0, 1], y=[0, 1, 0, 2], hue=pd.Series([1, 1, 3, 3], dtype=object))

~/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/relational.py in lineplot(x, y, hue, size, style, data, palette, hue_order, hue_norm, sizes, size_order, size_norm, dashes, markers, style_order, units, estimator, ci, n_boot, seed, sort, err_style, err_kws, legend, ax, **kwargs)
642         ax = plt.gca()
643
--> 644     p.plot(ax, kwargs)
645     return ax
646

~/code/seaborn/seaborn/relational.py in plot(self, ax, kws)
362         self.label_axes(ax)
363         if self.legend:
--> 364             self.add_legend_data(ax)
365             handles, _ = ax.get_legend_handles_labels()
366             if handles:

~/code/seaborn/seaborn/relational.py in add_legend_data(self, ax)
70                 locator = mpl.ticker.MaxNLocator(nbins=3)
71             limits = min(self._hue_map.levels), max(self._hue_map.levels)
---> 72             hue_levels, hue_formatted_levels = locator_to_legend_entries(
73                 locator, limits, self.plot_data["hue"].dtype
74             )

~/code/seaborn/seaborn/utils.py in locator_to_legend_entries(locator, limits, dtype)
564     # once pinned matplotlib>=3.1.0 with:
565     # formatted_levels = formatter.format_ticks(raw_levels)
--> 566     formatter.set_locs(raw_levels)
567     formatted_levels = [formatter(x) for x in raw_levels]
568

~/miniconda3/envs/seaborn-refactor/lib/python3.8/site-packages/matplotlib/ticker.py in set_locs(self, locs)
687                 self._compute_offset()
688             self._set_order_of_magnitude()
--> 689             self._set_format()
690
691     def _compute_offset(self):

~/miniconda3/envs/seaborn-refactor/lib/python3.8/site-packages/matplotlib/ticker.py in _set_format(self)
789         thresh = 1e-3 * 10 ** loc_range_oom
790         while sigfigs >= 0:
--> 791             if np.abs(locs - np.round(locs, decimals=sigfigs)).max() < thresh:
792                 sigfigs -= 1
793             else:

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

~/miniconda3/envs/seaborn-refactor/lib/python3.8/site-packages/numpy/core/fromnumeric.py in round_(a, decimals, out)
3597     around : equivalent function; see for details.
3598     """
-> 3599     return around(a, decimals=decimals, out=out)
3600
3601

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

~/miniconda3/envs/seaborn-refactor/lib/python3.8/site-packages/numpy/core/fromnumeric.py in around(a, decimals, out)
3222
3223     """
-> 3224     return _wrapfunc(a, 'round', decimals=decimals, out=out)
3225
3226

~/miniconda3/envs/seaborn-refactor/lib/python3.8/site-packages/numpy/core/fromnumeric.py in _wrapfunc(obj, method, *args, **kwds)
68         # Call _wrapit from within the except clause to ensure a potential
69         # exception has a traceback chain.
---> 70         return _wrapit(obj, method, *args, **kwds)
71
72

~/miniconda3/envs/seaborn-refactor/lib/python3.8/site-packages/numpy/core/fromnumeric.py in _wrapit(obj, method, *args, **kwds)
45     except AttributeError:
46         wrap = None
---> 47     result = getattr(asarray(obj), method)(*args, **kwds)
48     if wrap:
49         if not isinstance(result, mu.ndarray):

TypeError: loop of ufunc does not support argument 0 of type float which has no callable rint method

# Fixed code
def _deprecate_positional_args(f):
    """Decorator for methods that issues warnings for positional arguments.

    Using the keyword-only argument syntax in pep 3102, arguments after the
    * will issue a warning when passed as a positional argument.

    Parameters
    ----------
    f : function
        function to check arguments on

    """
    sig = signature(f)
    kwonly_args = []
    all_args = []

    for name, param in sig.parameters.items():
        if param.kind == Parameter.POSITIONAL_OR_KEYWORD:
            all_args.append(name)
        elif param.kind == Parameter.KEYWORD_ONLY:
            kwonly_args.append(name)

    @wraps(f)
    def inner_f(*args, **kwargs):
        extra_args = len(args) - len(all_args)
        if extra_args > 0:
            plural = "s" if extra_args > 1 else ""
            article = "" if plural else "a "
            warnings.warn(
                "Pass the following variable{} as {}keyword arg{}: {}. "
                "From version 0.12, the only valid positional argument "
                "will be `data`, and passing other arguments without an "
                "explicit keyword will result in an error or misinterpretation.".format(
                    plural, article, plural, ", ".join(kwonly_args[:extra_args])
                ),
                FutureWarning,
            )
        kwargs.update({k: arg for k, arg in zip(sig.parameters, args)})
        return f(**kwargs)

    return inner_f