Skip to content

Commit 9d27dec

Browse files
committed
add test for arrow function with first clause
1 parent 107fe18 commit 9d27dec

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/columns/test_jsonb.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,18 @@ def test_arrow_where(self):
5858
self.assertEqual(
5959
MyTable.count().where(MyTable.json.arrow("a") == "2").run_sync(), 0
6060
)
61+
62+
def test_arrow_first(self):
63+
"""
64+
Make sure the arrow function can be used with the first clause.
65+
"""
66+
MyTable.insert(
67+
MyTable(json='{"a": 1}'), MyTable(json='{"b": 2}'),
68+
).run_sync()
69+
70+
self.assertEqual(
71+
MyTable.select(MyTable.json.arrow("a").as_alias("json"))
72+
.first()
73+
.run_sync(),
74+
{"json": "1"},
75+
)

0 commit comments

Comments
 (0)