|
11 | 11 | )
|
12 | 12 | from pandas._libs.missing import is_matching_na
|
13 | 13 | import pandas._libs.testing as _testing
|
| 14 | +from pandas.util._exceptions import find_stack_level |
14 | 15 |
|
15 | 16 | from pandas.core.dtypes.common import (
|
16 | 17 | is_bool,
|
@@ -106,7 +107,7 @@ def assert_almost_equal(
|
106 | 107 | "is deprecated and will be removed in a future version. "
|
107 | 108 | "You can stop passing 'check_less_precise' to silence this warning.",
|
108 | 109 | FutureWarning,
|
109 |
| - stacklevel=2, |
| 110 | + stacklevel=find_stack_level(), |
110 | 111 | )
|
111 | 112 | # https://github.com/python/mypy/issues/7642
|
112 | 113 | # error: Argument 1 to "_get_tol_from_less_precise" has incompatible
|
@@ -340,7 +341,7 @@ def _get_ilevel_values(index, level):
|
340 | 341 | "is deprecated and will be removed in a future version. "
|
341 | 342 | "You can stop passing 'check_less_precise' to silence this warning.",
|
342 | 343 | FutureWarning,
|
343 |
| - stacklevel=2, |
| 344 | + stacklevel=find_stack_level(), |
344 | 345 | )
|
345 | 346 | # https://github.com/python/mypy/issues/7642
|
346 | 347 | # error: Argument 1 to "_get_tol_from_less_precise" has incompatible
|
@@ -818,7 +819,7 @@ def assert_extension_array_equal(
|
818 | 819 | "is deprecated and will be removed in a future version. "
|
819 | 820 | "You can stop passing 'check_less_precise' to silence this warning.",
|
820 | 821 | FutureWarning,
|
821 |
| - stacklevel=2, |
| 822 | + stacklevel=find_stack_level(), |
822 | 823 | )
|
823 | 824 | rtol = atol = _get_tol_from_less_precise(check_less_precise)
|
824 | 825 |
|
@@ -964,7 +965,7 @@ def assert_series_equal(
|
964 | 965 | "is deprecated and will be removed in a future version. "
|
965 | 966 | "You can stop passing 'check_less_precise' to silence this warning.",
|
966 | 967 | FutureWarning,
|
967 |
| - stacklevel=2, |
| 968 | + stacklevel=find_stack_level(), |
968 | 969 | )
|
969 | 970 | rtol = atol = _get_tol_from_less_precise(check_less_precise)
|
970 | 971 |
|
@@ -1247,7 +1248,7 @@ def assert_frame_equal(
|
1247 | 1248 | "is deprecated and will be removed in a future version. "
|
1248 | 1249 | "You can stop passing 'check_less_precise' to silence this warning.",
|
1249 | 1250 | FutureWarning,
|
1250 |
| - stacklevel=2, |
| 1251 | + stacklevel=find_stack_level(), |
1251 | 1252 | )
|
1252 | 1253 | rtol = atol = _get_tol_from_less_precise(check_less_precise)
|
1253 | 1254 |
|
|
0 commit comments