Skip to content

Commit d8a2394

Browse files
committed
fix test build
1 parent 014726e commit d8a2394

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

crates/catalog/rest/src/catalog.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,9 +2104,9 @@ mod tests {
21042104
.create_async()
21052105
.await;
21062106

2107-
let catalog = Arc::new(RestCatalog::new(
2107+
let catalog = RestCatalog::new(
21082108
RestCatalogConfig::builder().uri(server.url()).build(),
2109-
));
2109+
);
21102110

21112111
let table1 = {
21122112
let file = File::open(format!(
@@ -2130,7 +2130,7 @@ mod tests {
21302130
let table = Transaction::new(table1)
21312131
.upgrade_table_version(FormatVersion::V2)
21322132
.unwrap()
2133-
.commit(catalog)
2133+
.commit(Arc::new(&catalog))
21342134
.await
21352135
.unwrap();
21362136

@@ -2231,9 +2231,9 @@ mod tests {
22312231
.create_async()
22322232
.await;
22332233

2234-
let catalog = Arc::new(RestCatalog::new(
2234+
let catalog = RestCatalog::new(
22352235
RestCatalogConfig::builder().uri(server.url()).build(),
2236-
));
2236+
);
22372237

22382238
let table1 = {
22392239
let file = File::open(format!(
@@ -2254,10 +2254,10 @@ mod tests {
22542254
.unwrap()
22552255
};
22562256

2257-
let table_result = Transaction::new(&table1)
2257+
let table_result = Transaction::new(table1)
22582258
.upgrade_table_version(FormatVersion::V2)
22592259
.unwrap()
2260-
.commit(catalog)
2260+
.commit(Arc::new(&catalog))
22612261
.await;
22622262

22632263
assert!(table_result.is_err());

crates/catalog/rest/tests/rest_catalog_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ async fn test_update_table() {
350350
let table2 = Transaction::new(table)
351351
.set_properties(HashMap::from([("prop1".to_string(), "v1".to_string())]))
352352
.unwrap()
353-
.commit(Arc::new(catalog))
353+
.commit(Arc::new(&catalog))
354354
.await
355355
.unwrap();
356356

crates/iceberg/src/transaction/action/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ pub(crate) trait TransactionAction: Sync + Send {
3131
fn commit(self: Arc<Self>, tx: &mut Transaction) -> Result<()>;
3232
}
3333

34-
pub struct SetLocation {
34+
pub struct SetLocationAction {
3535
pub location: Option<String>,
3636
}
3737

38-
impl SetLocation {
38+
impl SetLocationAction {
3939
pub fn new() -> Self {
40-
SetLocation { location: None }
40+
SetLocationAction { location: None }
4141
}
4242

4343
pub fn set_location(mut self, location: String) -> Self {
@@ -46,7 +46,7 @@ impl SetLocation {
4646
}
4747
}
4848

49-
impl TransactionAction for SetLocation {
49+
impl TransactionAction for SetLocationAction {
5050
fn commit(self: Arc<Self>, tx: &mut Transaction) -> Result<()> {
5151
let updates: Vec<TableUpdate>;
5252
let requirements: Vec<TableRequirement>;

crates/iceberg/src/transaction/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use crate::TableUpdate::UpgradeFormatVersion;
3737
use crate::error::Result;
3838
use crate::spec::FormatVersion;
3939
use crate::table::Table;
40-
use crate::transaction::action::{BoxedTransactionAction, SetLocation, TransactionAction};
40+
use crate::transaction::action::{BoxedTransactionAction, SetLocationAction, TransactionAction};
4141
use crate::transaction::append::FastAppendAction;
4242
use crate::transaction::sort_order::ReplaceSortOrderAction;
4343
use crate::{Catalog, Error, ErrorKind, TableCommit, TableRequirement, TableUpdate};
@@ -195,7 +195,7 @@ impl Transaction {
195195

196196
/// Set the location of table
197197
pub fn set_location(mut self, location: String) -> Result<Self> {
198-
let set_location = SetLocation::new().set_location(location);
198+
let set_location = SetLocationAction::new().set_location(location);
199199
Arc::new(set_location).commit(&mut self)?;
200200
Ok(self)
201201
}

crates/integration_tests/tests/shared_tests/append_data_file_test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ async fn test_append_data_file() {
115115
let mut append_action = tx.fast_append(None, vec![]).unwrap();
116116
append_action.add_data_files(data_file.clone()).unwrap();
117117
let mut tx = append_action.apply().await.unwrap();
118-
let table = tx.commit(Arc::new(rest_catalog)).await.unwrap();
118+
let table = tx.commit(Arc::new(&rest_catalog)).await.unwrap();
119119

120120
// check result
121121
let batch_stream = table
@@ -135,7 +135,7 @@ async fn test_append_data_file() {
135135
let mut append_action = tx.fast_append(None, vec![]).unwrap();
136136
append_action.add_data_files(data_file.clone()).unwrap();
137137
let mut tx = append_action.apply().await.unwrap();
138-
let table = tx.commit(Arc::new(rest_catalog)).await.unwrap();
138+
let table = tx.commit(Arc::new(&rest_catalog)).await.unwrap();
139139

140140
// check result again
141141
let batch_stream = table

crates/integration_tests/tests/shared_tests/conflict_commit_test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ async fn test_append_data_file_conflict() {
9292
let tx1 = Transaction::new(table.clone());
9393
let mut append_action = tx1.fast_append(None, vec![]).unwrap();
9494
append_action.add_data_files(data_file.clone()).unwrap();
95-
let tx1 = append_action.apply().await.unwrap();
95+
let mut tx1 = append_action.apply().await.unwrap();
9696

9797
let tx2 = Transaction::new(table.clone());
9898
let mut append_action = tx2.fast_append(None, vec![]).unwrap();
@@ -117,5 +117,5 @@ async fn test_append_data_file_conflict() {
117117
assert_eq!(batches[0], batch);
118118

119119
// another commit should fail
120-
assert!(tx1.commit(&rest_catalog).await.is_err());
120+
assert!(tx1.commit(Arc::new(&rest_catalog)).await.is_err());
121121
}

crates/integration_tests/tests/shared_tests/scan_all_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ async fn test_scan_all_type() {
312312
let mut append_action = tx.fast_append(None, vec![]).unwrap();
313313
append_action.add_data_files(data_file.clone()).unwrap();
314314
let mut tx = append_action.apply().await.unwrap();
315-
let table = tx.commit(Arc::new(rest_catalog)).await.unwrap();
315+
let table = tx.commit(Arc::new(&rest_catalog)).await.unwrap();
316316

317317
// check result
318318
let batch_stream = table

0 commit comments

Comments
 (0)