Skip to content

Commit 444de91

Browse files
Fix imports
Signed-off-by: Abhi Agarwal <[email protected]>
1 parent 80063ac commit 444de91

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

etl-destinations/src/deltalake/schema.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use deltalake::arrow::array::{
88
TimestampMicrosecondArray, UInt32Array, new_empty_array,
99
};
1010
use deltalake::arrow::datatypes::{
11-
DataType as ArrowDataType, DecimalType, Field as ArrowField, Schema as ArrowSchema, TimeUnit,
11+
DataType as ArrowDataType, Field as ArrowField, Schema as ArrowSchema, TimeUnit,
1212
};
1313
use deltalake::arrow::error::ArrowError;
1414
use deltalake::arrow::record_batch::RecordBatch;
@@ -758,12 +758,17 @@ pub(crate) fn postgres_to_delta_schema(schema: &PgTableSchema) -> DeltaResult<De
758758
})
759759
.collect::<Result<Vec<_>, deltalake::DeltaTableError>>()?;
760760

761-
Ok(DeltaSchema::new(fields))
761+
let delta_schema = DeltaSchema::try_new(fields)?;
762+
Ok(delta_schema)
762763
}
763764

764765
#[cfg(test)]
765766
mod tests {
766767
use super::*;
768+
use chrono::{DateTime, NaiveDate, NaiveDateTime, NaiveTime, Utc};
769+
use deltalake::{DecimalType, PrimitiveType};
770+
use etl::types::{ColumnSchema, TableName, TableSchema as PgTableSchema, Type as PgType};
771+
use uuid::Uuid;
767772

768773
fn create_test_schema() -> PgTableSchema {
769774
PgTableSchema {
@@ -970,10 +975,6 @@ mod tests {
970975
}
971976
}
972977

973-
use chrono::{DateTime, NaiveDate, NaiveDateTime, NaiveTime, Utc};
974-
use etl::types::{ColumnSchema, TableName, TableSchema as PgTableSchema, Type as PgType};
975-
use uuid::Uuid;
976-
977978
#[test]
978979
fn test_empty_table_rows() {
979980
let schema = create_test_schema();

0 commit comments

Comments
 (0)