Skip to content

Commit

Permalink
docs: add See Also sections to some APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCrews authored and cpcloud committed Oct 4, 2023
1 parent 1a68f31 commit be8938f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
17 changes: 17 additions & 0 deletions ibis/expr/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,10 @@ def desc(expr: ir.Column | str) -> ir.Value:
expr
The expression or column name to use for sorting
See Also
--------
[`Value.desc()`](./expression-generic.qmd#ibis.expr.types.generic.Value.desc)
Examples
--------
>>> import ibis
Expand Down Expand Up @@ -533,6 +537,10 @@ def asc(expr: ir.Column | str) -> ir.Value:
expr
The expression or column name to use for sorting
See Also
--------
[`Value.asc()`](./expression-generic.qmd#ibis.expr.types.generic.Value.asc)
Examples
--------
>>> import ibis
Expand Down Expand Up @@ -1843,6 +1851,10 @@ def ifelse(condition: Any, true_expr: Any, false_expr: Any) -> ir.Value:
Value : ir.Value
The value of `true_expr` if `condition` is `True` else `false_expr`
See Also
--------
[`BooleanValue.ifelse()`](./expression-numeric.qmd#ibis.expr.types.logical.BooleanValue.ifelse)
Examples
--------
>>> import ibis
Expand Down Expand Up @@ -1902,6 +1914,11 @@ def coalesce(*args: Any) -> ir.Value:
Value
Coalesced expression
See Also
--------
[`Value.coalesce()`](#ibis.expr.types.generic.Value.coalesce)
[`Value.fillna()`](#ibis.expr.types.generic.Value.fillna)
Examples
--------
>>> import ibis
Expand Down
12 changes: 11 additions & 1 deletion ibis/expr/types/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from ibis.common.grounds import Singleton
from ibis.expr.types.core import Expr, _binop, _FixedTextJupyterMixin


if TYPE_CHECKING:
import pandas as pd
import pyarrow as pa
Expand Down Expand Up @@ -177,6 +176,7 @@ def try_cast(self, target_type: dt.DataType) -> Value:
def coalesce(self, *args: Value) -> Value:
"""Return the first non-null value from `args`.
Parameters
----------
args
Expand All @@ -187,6 +187,11 @@ def coalesce(self, *args: Value) -> Value:
Value
Coalesced expression
See Also
--------
[`ibis.coalesce()`](./expression-generic.qmd#ibis.coalesce)
[`Value.fillna()`](./expression-generic.qmd#ibis.expr.types.generic.Value.fillna)
Examples
--------
>>> import ibis
Expand Down Expand Up @@ -245,6 +250,11 @@ def fillna(self, fill_value: Scalar) -> Value:
fill_value
Value with which to replace `NA` values in `self`
See Also
--------
[`Value.coalesce()`](./expression-generic.qmd#ibis.expr.types.generic.Value.coalesce)
[`ibis.coalesce()`](./expression-generic.qmd#ibis.coalesce)
Examples
--------
>>> import ibis
Expand Down

0 comments on commit be8938f

Please sign in to comment.