Skip to content

Commit

Permalink
refactor(api): remove the how parameter from Value.arbitrary
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The `how` parameter of the `Value.arbitrary` method is removed. call `Value.first` or `Value.last` explicitly
  • Loading branch information
cpcloud committed Dec 18, 2024
1 parent 5506aa5 commit b258278
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions ibis/expr/types/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from ibis.common.grounds import Singleton
from ibis.expr.rewrites import rewrite_window_input
from ibis.expr.types.core import Expr, _binop, _FixedTextJupyterMixin, _is_null_literal
from ibis.util import deprecated, promote_list, warn_deprecated
from ibis.util import deprecated, promote_list

if TYPE_CHECKING:
import pandas as pd
Expand Down Expand Up @@ -2142,9 +2142,7 @@ def topk(

return table.aggregate(metric, by=[self]).order_by(metric.desc()).limit(k)

def arbitrary(
self, where: ir.BooleanValue | None = None, how: Any = None
) -> Scalar:
def arbitrary(self, where: ir.BooleanValue | None = None) -> Scalar:
"""Select an arbitrary value in a column.
Returns an arbitrary (nondeterministic, backend-specific) value from
Expand All @@ -2155,8 +2153,6 @@ def arbitrary(
----------
where
A filter expression
how
DEPRECATED
Returns
-------
Expand Down Expand Up @@ -2188,13 +2184,6 @@ def arbitrary(
│ 2 │ a │ 8.3 │
└───────┴────────┴─────────┘
"""
if how is not None:
warn_deprecated(
name="how",
as_of="9.0",
removed_in="10.0",
instead="call `first` or `last` explicitly",
)
return ops.Arbitrary(self, where=self._bind_to_parent_table(where)).to_expr()

def count(self, where: ir.BooleanValue | None = None) -> ir.IntegerScalar:
Expand Down

0 comments on commit b258278

Please sign in to comment.