diff --git a/src/daft-csv/src/read.rs b/src/daft-csv/src/read.rs index 68c5ebe144..850b65d711 100644 --- a/src/daft-csv/src/read.rs +++ b/src/daft-csv/src/read.rs @@ -289,7 +289,7 @@ async fn read_csv_single_into_table( .zip(&read_fields) .map(|(array, field)| Series::try_from((field.name.as_ref(), array))) .collect::>>()?; - let table = Table::new(owned_read_schema.clone(), columns_series)?; + let table = Table::new_unchecked(owned_read_schema.clone(), columns_series); if let Some(predicate) = &predicate { let filtered = table.filter(&[predicate.as_ref()])?; if let Some(include_columns) = &include_columns { diff --git a/src/daft-table/src/lib.rs b/src/daft-table/src/lib.rs index 154e53d991..20366460db 100644 --- a/src/daft-table/src/lib.rs +++ b/src/daft-table/src/lib.rs @@ -71,6 +71,14 @@ impl Table { }) } + + pub fn new_unchecked>(schema: S, columns: Vec) -> Self { + Table { + schema: schema.into(), + columns: columns, + } + } + pub fn empty(schema: Option) -> DaftResult { match schema { Some(schema) => {