Skip to content

Commit 910e943

Browse files
committed
added test case for pyarrow Schema equals
1 parent 24cf982 commit 910e943

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

python/pyarrow/tests/test_schema.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,20 @@ def test_schema(self):
6969
foo: int32
7070
bar: string
7171
baz: list<item: int8>"""
72+
73+
def test_schema_equals(self):
74+
fields = [
75+
A.field('foo', A.int32()),
76+
A.field('bar', A.string()),
77+
A.field('baz', A.list_(A.int8()))
78+
]
79+
80+
sch1 = A.schema(fields)
81+
print(dir(sch1))
82+
sch2 = A.schema(fields)
83+
assert sch1.equals(sch2)
84+
85+
del fields[-1]
86+
sch3 = A.schema(fields)
87+
assert not sch1.equals(sch3)
88+

0 commit comments

Comments
 (0)