Skip to content

Commit dd66af2

Browse files
committed
docs(name): improve docstring of Value.name API
1 parent 5b0f987 commit dd66af2

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

ibis/expr/types/generic.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,26 @@ def name(self, name):
4242
Examples
4343
--------
4444
>>> import ibis
45-
>>> t = ibis.table(dict(a="int64"), name="t")
45+
>>> ibis.options.interactive = True
46+
>>> t = ibis.memtable({"a": [1, 2]}, name="t")
47+
>>> t.a
48+
┏━━━━━━━┓
49+
┃ a ┃
50+
┡━━━━━━━┩
51+
│ int64 │
52+
├───────┤
53+
│ 1 │
54+
│ 2 │
55+
└───────┘
4656
>>> t.a.name("b")
47-
r0 := UnboundTable: t
48-
a int64
49-
b: r0.a
57+
┏━━━━━━━┓
58+
┃ b ┃
59+
┡━━━━━━━┩
60+
│ int64 │
61+
├───────┤
62+
│ 1 │
63+
│ 2 │
64+
└───────┘
5065
"""
5166
# TODO(kszucs): shouldn't do simplification here, but rather later
5267
# when simplifying the whole operation tree

0 commit comments

Comments
 (0)