Skip to content

Commit 41ea0c7

Browse files
IndexSeekcpcloud
authored andcommitted
docs(api): use memtable for pipe docstring
1 parent a691030 commit 41ea0c7

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

ibis/expr/types/core.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,23 @@ def pipe(self, f, *args: Any, **kwargs: Any) -> Expr:
278278
Examples
279279
--------
280280
>>> import ibis
281-
>>> t = ibis.table([("a", "int64"), ("b", "string")], name="t")
281+
>>> t = ibis.memtable(
282+
... {
283+
... "a": [5, 10, 15],
284+
... "b": ["a", "b", "c"],
285+
... }
286+
... )
282287
>>> f = lambda a: (a + 1).name("a")
283288
>>> g = lambda a: (a * 2).name("a")
284289
>>> result1 = t.a.pipe(f).pipe(g)
285290
>>> result1
286-
r0 := UnboundTable: t
287-
a int64
288-
b string
291+
r0 := InMemoryTable
292+
data:
293+
PandasDataFrameProxy:
294+
a b
295+
0 5 a
296+
1 10 b
297+
2 15 c
289298
a: r0.a + 1 * 2
290299
291300
>>> result2 = g(f(t.a)) # equivalent to the above

0 commit comments

Comments
 (0)