@@ -1079,6 +1079,26 @@ def response_handler(resp: Response) -> Json:
1079
1079
1080
1080
return await self ._executor .execute (request , response_handler )
1081
1081
1082
+ async def list_transactions (self ) -> Result [Jsons ]:
1083
+ """List all currently running stream transactions.
1084
+
1085
+ Returns:
1086
+ list: List of transactions, with each transaction containing
1087
+ an "id" and a "state" field.
1088
+
1089
+ Raises:
1090
+ TransactionListError: If the operation fails on the server side.
1091
+ """
1092
+ request = Request (method = Method .GET , endpoint = "/_api/transaction" )
1093
+
1094
+ def response_handler (resp : Response ) -> Jsons :
1095
+ if not resp .is_success :
1096
+ raise TransactionListError (resp , request )
1097
+ result : Json = self .deserializer .loads (resp .raw_body )
1098
+ return cast (Jsons , result ["transactions" ])
1099
+
1100
+ return await self ._executor .execute (request , response_handler )
1101
+
1082
1102
1083
1103
class StandardDatabase (Database ):
1084
1104
"""Standard database API wrapper.
@@ -1188,26 +1208,6 @@ def fetch_transaction(self, transaction_id: str) -> "TransactionDatabase":
1188
1208
"""
1189
1209
return TransactionDatabase (self .connection , transaction_id )
1190
1210
1191
- async def list_transactions (self ) -> Result [Jsons ]:
1192
- """List all currently running stream transactions.
1193
-
1194
- Returns:
1195
- list: List of transactions, with each transaction containing
1196
- an "id" and a "state" field.
1197
-
1198
- Raises:
1199
- TransactionListError: If the operation fails on the server side.
1200
- """
1201
- request = Request (method = Method .GET , endpoint = "/_api/transaction" )
1202
-
1203
- def response_handler (resp : Response ) -> Jsons :
1204
- if not resp .is_success :
1205
- raise TransactionListError (resp , request )
1206
- result : Json = self .deserializer .loads (resp .raw_body )
1207
- return cast (Jsons , result ["transactions" ])
1208
-
1209
- return await self ._executor .execute (request , response_handler )
1210
-
1211
1211
1212
1212
class TransactionDatabase (Database ):
1213
1213
"""Database API tailored specifically for
0 commit comments