From f711337ca9d6ee5cf1bca89f1ba0a2545919704c Mon Sep 17 00:00:00 2001 From: Nick Crews Date: Fri, 5 Jan 2024 00:05:17 -0900 Subject: [PATCH] depr: deprecate Value.least() and Value.greatest() moves towards https://github.com/ibis-project/ibis/issues/7295. This just removes the methods from the docs (by removing the docstring) and informs current users of the API as to the upgrade path (using the `@deprecated` decorator) --- ibis/expr/types/generic.py | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/ibis/expr/types/generic.py b/ibis/expr/types/generic.py index 0f4ff974389c..f957642eee5d 100644 --- a/ibis/expr/types/generic.py +++ b/ibis/expr/types/generic.py @@ -12,6 +12,7 @@ import ibis.expr.operations as ops from ibis.common.grounds import Singleton from ibis.expr.types.core import Expr, _binop, _FixedTextJupyterMixin +from ibis.util import deprecated if TYPE_CHECKING: import pandas as pd @@ -297,34 +298,12 @@ def coalesce(self, *args: Value) -> Value: """ return ops.Coalesce((self, *args)).to_expr() - def greatest(self, *args: ir.Value) -> ir.Value: - """Compute the largest value among the supplied arguments. - - Parameters - ---------- - args - Arguments to choose from - - Returns - ------- - Value - Maximum of the passed arguments - """ + @deprecated(as_of="8.0.0", instead="use ibis.greatest(self, rest...) instead") + def greatest(self, *args: ir.Value) -> ir.Value: # noqa: D102 return ops.Greatest((self, *args)).to_expr() - def least(self, *args: ir.Value) -> ir.Value: - """Compute the smallest value among the supplied arguments. - - Parameters - ---------- - args - Arguments to choose from - - Returns - ------- - Value - Minimum of the passed arguments - """ + @deprecated(as_of="8.0.0", instead="use ibis.least(self, rest...) instead") + def least(self, *args: ir.Value) -> ir.Value: # noqa: D102 return ops.Least((self, *args)).to_expr() def typeof(self) -> ir.StringValue: