Skip to content

Commit

Permalink
docs(reference): soft-deprecate ibis.where
Browse files Browse the repository at this point in the history
Per #7147
  • Loading branch information
NickCrews authored and cpcloud committed Sep 27, 2023
1 parent a49d259 commit 3c94f7b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 33 deletions.
2 changes: 0 additions & 2 deletions docs/_quarto.yml
Expand Up @@ -284,8 +284,6 @@ quartodoc:
dynamic: true
- name: union
dynamic: true
- name: where
package: ibis.expr.api
- name: window
dynamic: true

Expand Down
32 changes: 1 addition & 31 deletions ibis/expr/api.py
Expand Up @@ -1806,38 +1806,8 @@ def watermark(time_col: str, allowed_delay: ir.IntervalScalar) -> Watermark:
│ no │
└───────────────────────────────┘
"""
# Deprecated, use ifelse instead: https://github.com/ibis-project/ibis/issues/7147
where = _deferred(ir.BooleanValue.ifelse)
"""Construct a ternary conditional expression.
Parameters
----------
true_expr : ir.Value
Expression to return if `self` evaluates to `True`
false_expr : ir.Value
Expression to return if `self` evaluates to `False` or `NULL`
Returns
-------
Value : ir.Value
The value of `true_expr` if `arg` is `True` else `false_expr`
Examples
--------
>>> import ibis
>>> ibis.options.interactive = True
>>> t = ibis.memtable({"is_person": [True, False, True, None]})
>>> ibis.where(t.is_person, "yes", "no")
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Where(is_person, 'yes', 'no') ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ string │
├───────────────────────────────┤
│ yes │
│ no │
│ yes │
│ no │
└───────────────────────────────┘
"""
coalesce = _deferred(ir.Value.coalesce)
greatest = _deferred(ir.Value.greatest)
least = _deferred(ir.Value.least)
Expand Down

0 comments on commit 3c94f7b

Please sign in to comment.