Skip to content

Commit 99ff7b8

Browse files
Koladata Teamcopybara-github
authored andcommitted
Fix the cheatsheet to not use the temporarily removed method.
PiperOrigin-RevId: 891746303 Change-Id: Ib0448fbfc825e2cbb170e046a72853a63dffd70e
1 parent bbdc023 commit 99ff7b8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/cheatsheet.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ kd.dir(e) # ['x', 'y']
183183
# Or
184184
# As all entities share the same schema,
185185
# the intersection of attribute names is the same
186-
e.get_attr_names(intersection=True) # ['x', 'y']
187-
e.get_attr_names(intersection=False) # ['x', 'y']
186+
kd.get_attr_names(e, intersection=True) # ['x', 'y']
187+
kd.get_attr_names(e, intersection=False) # ['x', 'y']
188188

189189
# Access attribute
190190
e.x # 1
@@ -406,8 +406,8 @@ os1 = kd.slice([kd.obj(x=1), kd.obj(x=1.0, y='a')])
406406
# Attributes present in all objects
407407
kd.dir(os1) # ['x']
408408
# Or
409-
os1.get_attr_names(intersection=True) # ['x']
410-
os1.get_attr_names(intersection=False) # ['x', 'y']
409+
kd.get_attr_names(os1, intersection=True) # ['x']
410+
kd.get_attr_names(os1, intersection=False) # ['x', 'y']
411411

412412
# Access attribute
413413
o.x # 1
@@ -2836,15 +2836,15 @@ obj = kd.obj(x=1, y=kd.obj(z=1))
28362836
# Create a obj stub without attributes
28372837
obj2 = obj.stub()
28382838
assert obj2.get_itemid() == obj.get_itemid()
2839-
assert not obj2.get_attr_names(intersection=False) # []
2839+
assert not kd.get_attr_names(obj2, intersection=False) # []
28402840

28412841
# Create a list stub with list item stubs
28422842
l = kd.list([kd.obj(x=1), kd.obj(x=2)])
28432843
l2 = l.stub()
28442844
assert l2.get_itemid() == l.get_itemid()
28452845
# List items are stubbed as well
28462846
assert kd.agg_all(l2[:] == l[:])
2847-
assert not l2[:].get_attr_names(intersection=False) # []
2847+
assert not kd.get_attr_names(l2[:], intersection=False) # []
28482848

28492849
# Create a dict stub without entries
28502850
d = kd.dict({'a': kd.obj(x=1), 'b': kd.obj(x=2)})

0 commit comments

Comments
 (0)