We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
TypeError
get_attributes
1 parent b6fe018 commit f29de23Copy full SHA for f29de23
asyncpg/protocol/prepared_stmt.pyx
@@ -40,6 +40,9 @@ cdef class PreparedStatementState:
40
def _get_attributes(self):
41
cdef Codec codec
42
43
+ if not self.row_desc:
44
+ return ()
45
+
46
result = []
47
for d in self.row_desc:
48
name = d[0]
tests/test_codecs.py
@@ -1398,3 +1398,7 @@ async def test_enum_and_range(self):
1398
DROP TABLE testtab;
1399
DROP TYPE enum_t;
1400
''')
1401
1402
+ async def test_no_result(self):
1403
+ st = await self.con.prepare('rollback')
1404
+ self.assertTupleEqual(st.get_attributes(), ())
0 commit comments