From e3e8af76983a1f4bc9ce921920c0f7440c8b7a4c Mon Sep 17 00:00:00 2001 From: Michael-J-Ward Date: Wed, 31 Jul 2024 02:36:24 -0500 Subject: [PATCH] return unsupported_variants for unimplemented variants in PyLogicalPlan::to_variant --- src/sql/logical.rs | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/sql/logical.rs b/src/sql/logical.rs index 0e530598f..c4471f503 100644 --- a/src/sql/logical.rs +++ b/src/sql/logical.rs @@ -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; @@ -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 + ))), } }