@@ -100,10 +100,7 @@ async fn test_commit_info() -> Result<(), Box<dyn std::error::Error>> {
100
100
) ] ) ) ;
101
101
let table = create_table ( store. clone ( ) , table_location, schema, & [ ] ) . await ?;
102
102
103
- // create a transaction
104
- let mut txn = table. new_transaction ( & engine) ?;
105
-
106
- // add commit info of the form {engineCommitInfo: Map { "engineInfo": "default engine" } }
103
+ // create commit info of the form {engineCommitInfo: Map { "engineInfo": "default engine" } }
107
104
let commit_info_schema = Arc :: new ( ArrowSchema :: new ( vec ! [ Field :: new(
108
105
"engineCommitInfo" ,
109
106
ArrowDataType :: Map (
@@ -139,7 +136,11 @@ async fn test_commit_info() -> Result<(), Box<dyn std::error::Error>> {
139
136
140
137
let commit_info_batch =
141
138
RecordBatch :: try_new ( commit_info_schema. clone ( ) , vec ! [ Arc :: new( array) ] ) ?;
142
- txn. commit_info ( Box :: new ( ArrowEngineData :: new ( commit_info_batch) ) ) ;
139
+
140
+ // create a transaction
141
+ let txn = table
142
+ . new_transaction ( & engine) ?
143
+ . with_commit_info ( Box :: new ( ArrowEngineData :: new ( commit_info_batch) ) ) ;
143
144
144
145
// commit!
145
146
txn. commit ( & engine) ?;
@@ -212,11 +213,12 @@ async fn test_invalid_commit_info() -> Result<(), Box<dyn std::error::Error>> {
212
213
let table = create_table ( store. clone ( ) , table_location, schema, & [ ] ) . await ?;
213
214
214
215
// empty commit info test
215
- let mut txn = table. new_transaction ( & engine) ?;
216
216
let commit_info_schema = Arc :: new ( ArrowSchema :: empty ( ) ) ;
217
217
let commit_info_batch = RecordBatch :: new_empty ( commit_info_schema. clone ( ) ) ;
218
218
assert ! ( commit_info_batch. num_rows( ) == 0 ) ;
219
- txn. commit_info ( Box :: new ( ArrowEngineData :: new ( commit_info_batch) ) ) ;
219
+ let txn = table
220
+ . new_transaction ( & engine) ?
221
+ . with_commit_info ( Box :: new ( ArrowEngineData :: new ( commit_info_batch) ) ) ;
220
222
221
223
// commit!
222
224
assert ! ( matches!(
@@ -225,7 +227,6 @@ async fn test_invalid_commit_info() -> Result<(), Box<dyn std::error::Error>> {
225
227
) ) ;
226
228
227
229
// two-row commit info test
228
- let mut txn = table. new_transaction ( & engine) ?;
229
230
let commit_info_schema = Arc :: new ( ArrowSchema :: new ( vec ! [ Field :: new(
230
231
"engineInfo" ,
231
232
ArrowDataType :: Utf8 ,
@@ -239,7 +240,9 @@ async fn test_invalid_commit_info() -> Result<(), Box<dyn std::error::Error>> {
239
240
] ) ) ] ,
240
241
) ?;
241
242
242
- txn. commit_info ( Box :: new ( ArrowEngineData :: new ( commit_info_batch) ) ) ;
243
+ let txn = table
244
+ . new_transaction ( & engine) ?
245
+ . with_commit_info ( Box :: new ( ArrowEngineData :: new ( commit_info_batch) ) ) ;
243
246
244
247
// commit!
245
248
assert ! ( matches!(
0 commit comments