Skip to content

Commit

Permalink
docs(api): use memtable for pipe docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
IndexSeek authored and cpcloud committed Oct 13, 2024
1 parent a691030 commit 41ea0c7
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions ibis/expr/types/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,23 @@ def pipe(self, f, *args: Any, **kwargs: Any) -> Expr:
Examples
--------
>>> import ibis
>>> t = ibis.table([("a", "int64"), ("b", "string")], name="t")
>>> t = ibis.memtable(
... {
... "a": [5, 10, 15],
... "b": ["a", "b", "c"],
... }
... )
>>> f = lambda a: (a + 1).name("a")
>>> g = lambda a: (a * 2).name("a")
>>> result1 = t.a.pipe(f).pipe(g)
>>> result1
r0 := UnboundTable: t
a int64
b string
r0 := InMemoryTable
data:
PandasDataFrameProxy:
a b
0 5 a
1 10 b
2 15 c
a: r0.a + 1 * 2
>>> result2 = g(f(t.a)) # equivalent to the above
Expand Down

0 comments on commit 41ea0c7

Please sign in to comment.