Skip to content

Commit a5081f9

Browse files
committed
Fix unit tests to use StructType::new_unchecked
- Update unit tests in create_table.rs to use new_unchecked instead of new - Apply code formatting to write-table example - All 838 tests now passing (663 lib + 175 integration tests)
1 parent 7659cef commit a5081f9

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

kernel/examples/write-table/src/main.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,12 @@ fn parse_schema(schema_str: &str) -> DeltaResult<SchemaRef> {
195195
}
196196

197197
/// Create a new Delta table with the given schema using the official CreateTable API.
198-
async fn create_table(
199-
table_url: &Url,
200-
schema: &SchemaRef,
201-
engine: &dyn Engine,
202-
) -> DeltaResult<()> {
198+
async fn create_table(table_url: &Url, schema: &SchemaRef, engine: &dyn Engine) -> DeltaResult<()> {
203199
// Use the new TableManager API to create the table
204200
let table_path = table_url.as_str();
205-
let create_txn = TableManager::create_table(table_path, schema.clone(), "write-table-example/1.0")
206-
.build(engine)?;
201+
let create_txn =
202+
TableManager::create_table(table_path, schema.clone(), "write-table-example/1.0")
203+
.build(engine)?;
207204

208205
// Commit the metadata - this creates the table
209206
let _txn = create_txn.commit_metadata(engine, Box::new(FileSystemCommitter::new()))?;

kernel/src/transaction/create_table.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ mod tests {
304304

305305
#[test]
306306
fn test_builder_creation() {
307-
let schema = Arc::new(StructType::new(vec![StructField::new(
307+
let schema = Arc::new(StructType::new_unchecked(vec![StructField::new(
308308
"id",
309309
DataType::INTEGER,
310310
false,
@@ -320,7 +320,7 @@ mod tests {
320320

321321
#[test]
322322
fn test_with_table_properties() {
323-
let schema = Arc::new(StructType::new(vec![StructField::new(
323+
let schema = Arc::new(StructType::new_unchecked(vec![StructField::new(
324324
"id",
325325
DataType::INTEGER,
326326
false,
@@ -340,7 +340,7 @@ mod tests {
340340

341341
#[test]
342342
fn test_with_multiple_table_properties() {
343-
let schema = Arc::new(StructType::new(vec![StructField::new(
343+
let schema = Arc::new(StructType::new_unchecked(vec![StructField::new(
344344
"id",
345345
DataType::INTEGER,
346346
false,

0 commit comments

Comments
 (0)