Skip to content

Commit

Permalink
return unsupported_variants for unimplemented variants in PyLogicalPl…
Browse files Browse the repository at this point in the history
…an::to_variant
  • Loading branch information
Michael-J-Ward committed Jul 31, 2024
1 parent 5804ced commit e3e8af7
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/sql/logical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

use std::sync::Arc;

use crate::errors::py_unsupported_variant_err;
use crate::expr::aggregate::PyAggregate;
use crate::expr::analyze::PyAnalyze;
use crate::expr::cross_join::PyCrossJoin;
Expand Down Expand Up @@ -80,16 +81,19 @@ impl PyLogicalPlan {
LogicalPlan::SubqueryAlias(plan) => PySubqueryAlias::from(plan.clone()).to_variant(py),
LogicalPlan::Unnest(plan) => PyUnnest::from(plan.clone()).to_variant(py),
LogicalPlan::Window(plan) => PyWindow::from(plan.clone()).to_variant(py),
LogicalPlan::Repartition(_) => todo!(),
LogicalPlan::Union(_) => todo!(),
LogicalPlan::Statement(_) => todo!(),
LogicalPlan::Values(_) => todo!(),
LogicalPlan::Prepare(_) => todo!(),
LogicalPlan::Dml(_) => todo!(),
LogicalPlan::Ddl(_) => todo!(),
LogicalPlan::Copy(_) => todo!(),
LogicalPlan::DescribeTable(_) => todo!(),
LogicalPlan::RecursiveQuery(_) => todo!(),
LogicalPlan::Repartition(_)
| LogicalPlan::Union(_)
| LogicalPlan::Statement(_)
| LogicalPlan::Values(_)
| LogicalPlan::Prepare(_)
| LogicalPlan::Dml(_)
| LogicalPlan::Ddl(_)
| LogicalPlan::Copy(_)
| LogicalPlan::DescribeTable(_)
| LogicalPlan::RecursiveQuery(_) => Err(py_unsupported_variant_err(format!(
"Conversion of variant not implemented: {:?}",
self.plan
))),
}
}

Expand Down

0 comments on commit e3e8af7

Please sign in to comment.