|
72 | 72 | NativeFrameT_co, |
73 | 73 | NativeSeriesT_co, |
74 | 74 | ) |
75 | | - from narwhals._compliant.typing import CompliantSeriesOrExprT, EvalNames |
| 75 | + from narwhals._compliant.typing import EvalNames |
76 | 76 | from narwhals._namespace import EagerAllowedImplementation, Namespace |
77 | 77 | from narwhals._translate import ArrowStreamExportable, IntoArrowTable, ToNarwhalsT_co |
78 | 78 | from narwhals.dataframe import DataFrame, LazyFrame |
@@ -2038,20 +2038,42 @@ def deep_getattr(obj: Any, name_1: str, *nested: str) -> Any: |
2038 | 2038 | return deep_attrgetter(name_1, *nested)(obj) |
2039 | 2039 |
|
2040 | 2040 |
|
| 2041 | +@overload |
| 2042 | +def _is_close_impl( |
| 2043 | + self: CompliantExprT, |
| 2044 | + other: CompliantExprT | NumericLiteral, |
| 2045 | + *, |
| 2046 | + abs_tol: float, |
| 2047 | + rel_tol: float, |
| 2048 | + nans_equal: bool, |
| 2049 | +) -> CompliantExprT: ... |
| 2050 | + |
| 2051 | + |
| 2052 | +@overload |
| 2053 | +def _is_close_impl( |
| 2054 | + self: CompliantSeriesT, |
| 2055 | + other: CompliantSeriesT | NumericLiteral, |
| 2056 | + *, |
| 2057 | + abs_tol: float, |
| 2058 | + rel_tol: float, |
| 2059 | + nans_equal: bool, |
| 2060 | +) -> CompliantSeriesT: ... |
| 2061 | + |
| 2062 | + |
2041 | 2063 | def _is_close_impl( |
2042 | | - self: CompliantSeriesOrExprT, |
2043 | | - other: CompliantSeriesOrExprT | NumericLiteral, |
| 2064 | + self: CompliantExprT | CompliantSeriesT, |
| 2065 | + other: CompliantExprT | CompliantSeriesT | NumericLiteral, |
2044 | 2066 | *, |
2045 | 2067 | abs_tol: float, |
2046 | 2068 | rel_tol: float, |
2047 | 2069 | nans_equal: bool, |
2048 | | -) -> CompliantSeriesOrExprT: |
| 2070 | +) -> CompliantExprT | CompliantSeriesT: |
2049 | 2071 | from decimal import Decimal |
2050 | 2072 |
|
2051 | | - other_abs: CompliantSeriesOrExprT | NumericLiteral |
2052 | | - other_is_nan: CompliantSeriesOrExprT | bool |
2053 | | - other_is_inf: CompliantSeriesOrExprT | bool |
2054 | | - other_is_not_inf: CompliantSeriesOrExprT | bool |
| 2073 | + other_abs: CompliantExprT | CompliantSeriesT | NumericLiteral |
| 2074 | + other_is_nan: CompliantExprT | CompliantSeriesT | bool |
| 2075 | + other_is_inf: CompliantExprT | CompliantSeriesT | bool |
| 2076 | + other_is_not_inf: CompliantExprT | CompliantSeriesT | bool |
2055 | 2077 |
|
2056 | 2078 | if isinstance(other, (float, int, Decimal)): |
2057 | 2079 | from math import isinf, isnan |
|
0 commit comments