Skip to content

Commit

Permalink
new unchecked table
Browse files Browse the repository at this point in the history
  • Loading branch information
samster25 committed Dec 12, 2023
1 parent 7911834 commit 48d039b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/daft-csv/src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<DaftResult<Vec<Series>>>()?;
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 {
Expand Down
8 changes: 8 additions & 0 deletions src/daft-table/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ impl Table {
})
}


pub fn new_unchecked<S: Into<SchemaRef>>(schema: S, columns: Vec<Series>) -> Self {
Table {
schema: schema.into(),
columns: columns,
}
}

pub fn empty(schema: Option<SchemaRef>) -> DaftResult<Self> {
match schema {
Some(schema) => {
Expand Down

0 comments on commit 48d039b

Please sign in to comment.