Skip to content

Commit dd4ec7c

Browse files
committed
fix tests
1 parent fd236fd commit dd4ec7c

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

datafusion_iceberg/src/table.rs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ mod tests {
14451445
};
14461446
use iceberg_sql_catalog::SqlCatalog;
14471447

1448-
use std::{ops::Deref, sync::Arc};
1448+
use std::sync::Arc;
14491449

14501450
use crate::{catalog::catalog::IcebergCatalog, table::fake_object_store_url, DataFusionTable};
14511451

@@ -1670,9 +1670,12 @@ mod tests {
16701670
}
16711671
}
16721672

1673-
if let Tabular::Table(table) = table.tabular.read().unwrap().deref() {
1674-
assert_eq!(table.manifests(None, None).await.unwrap().len(), 2);
1673+
let table = if let Tabular::Table(table) = table.tabular.read().unwrap().clone() {
1674+
table
1675+
} else {
1676+
panic!()
16751677
};
1678+
assert_eq!(table.manifests(None, None).await.unwrap().len(), 2);
16761679
}
16771680

16781681
#[tokio::test]
@@ -1856,9 +1859,12 @@ mod tests {
18561859
}
18571860
}
18581861

1859-
if let Tabular::Table(table) = table.tabular.read().unwrap().deref() {
1860-
assert_eq!(table.manifests(None, None).await.unwrap().len(), 2);
1862+
let table = if let Tabular::Table(table) = table.tabular.read().unwrap().clone() {
1863+
table
1864+
} else {
1865+
panic!();
18611866
};
1867+
assert_eq!(table.manifests(None, None).await.unwrap().len(), 2);
18621868
}
18631869

18641870
#[tokio::test]
@@ -2047,9 +2053,12 @@ mod tests {
20472053
}
20482054
}
20492055

2050-
if let Tabular::Table(table) = table.tabular.read().unwrap().deref() {
2051-
assert_eq!(table.manifests(None, None).await.unwrap().len(), 2);
2056+
let table = if let Tabular::Table(table) = table.tabular.read().unwrap().clone() {
2057+
table
2058+
} else {
2059+
panic!();
20522060
};
2061+
assert_eq!(table.manifests(None, None).await.unwrap().len(), 2);
20532062
}
20542063

20552064
#[tokio::test]

0 commit comments

Comments
 (0)