Skip to content

Commit

Permalink
interface cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiayue Charles Lin committed Jul 31, 2023
1 parent e978d11 commit d032844
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/daft-plan/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ impl LogicalPlanBuilder {
impl LogicalPlanBuilder {
#[staticmethod]
pub fn source(filepaths: Vec<String>, schema: &PySchema) -> PyResult<LogicalPlanBuilder> {
let source_info = source_info::SourceInfo::FilesInfo(source_info::FilesInfo {
let source_info = source_info::SourceInfo::FilesInfo(source_info::FilesInfo::new(
filepaths,
schema: schema.schema.clone(),
});
schema.schema.clone(),
));
let logical_plan_builder = LogicalPlanBuilder::from_source(ops::Source::new(
schema.schema.clone(),
source_info.into(),
Expand Down
2 changes: 1 addition & 1 deletion src/daft-plan/src/ops/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct Source {

impl Source {
pub(crate) fn new(schema: SchemaRef, source_info: Arc<SourceInfo>) -> Self {
Source {
Self {
schema,
source_info,
filters: vec![], // Will be populated by plan optimizer.
Expand Down
6 changes: 6 additions & 0 deletions src/daft-plan/src/source_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ pub struct FilesInfo {
pub filepaths: Vec<String>, // TODO: pull in some sort of URL crate for this
pub schema: SchemaRef,
}

impl FilesInfo {
pub(crate) fn new(filepaths: Vec<String>, schema: SchemaRef) -> Self {
Self { filepaths, schema }
}
}

0 comments on commit d032844

Please sign in to comment.