Skip to content

Commit

Permalink
depr: deprecate Value.least() and Value.greatest()
Browse files Browse the repository at this point in the history
moves towards #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)
  • Loading branch information
NickCrews authored and cpcloud committed Jan 16, 2024
1 parent b3f0ee8 commit f711337
Showing 1 changed file with 5 additions and 26 deletions.
31 changes: 5 additions & 26 deletions ibis/expr/types/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit f711337

Please sign in to comment.