diff --git a/pandas/core/reshape/merge.py b/pandas/core/reshape/merge.py index 5012be593820e..491e3cb39ef3d 100644 --- a/pandas/core/reshape/merge.py +++ b/pandas/core/reshape/merge.py @@ -1978,7 +1978,13 @@ def _factorize_keys( lany = lmask.any() rmask = rlab == -1 rany = rmask.any() - + if lany and rany: + warnings.warn( + "Matching nan on nan in merge is not supported and will not match in " + "a future version.", + FutureWarning, + stacklevel=8, + ) if lany or rany: if lany: np.putmask(llab, lmask, count)