From 18423b443d8218f6b504dcaa0b68e30738d9b9aa Mon Sep 17 00:00:00 2001 From: nam2ee Date: Sun, 9 Aug 2026 13:09:21 +0900 Subject: [PATCH] fix: return error instead of panic when decoding ParquetScan/AvroScan without features --- datafusion/proto/src/physical_plan/mod.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/datafusion/proto/src/physical_plan/mod.rs b/datafusion/proto/src/physical_plan/mod.rs index 3cfd7fc3188c..0c36dca9b427 100644 --- a/datafusion/proto/src/physical_plan/mod.rs +++ b/datafusion/proto/src/physical_plan/mod.rs @@ -1086,8 +1086,8 @@ pub trait PhysicalPlanNodeExt: Sized { ParquetSource::try_from_proto(self.node(), &decode_ctx) } #[cfg(not(feature = "parquet"))] - panic!( - "Unable to process a Parquet PhysicalPlan when `parquet` feature is not enabled" + not_impl_err!( + "Unable to process a Parquet PhysicalPlan when the `parquet` feature is not enabled" ) } PhysicalPlanType::AvroScan(scan) => { @@ -1423,8 +1423,8 @@ pub trait PhysicalPlanNodeExt: Sized { } #[cfg(not(feature = "parquet"))] - panic!( - "Unable to process a Parquet PhysicalPlan when `parquet` feature is not enabled" + not_impl_err!( + "Unable to process a Parquet PhysicalPlan when the `parquet` feature is not enabled" ) } @@ -1449,7 +1449,9 @@ pub trait PhysicalPlanNodeExt: Sized { } #[cfg(not(feature = "avro"))] - panic!("Unable to process a Avro PhysicalPlan when `avro` feature is not enabled") + not_impl_err!( + "Unable to process an Avro PhysicalPlan when the `avro` feature is not enabled" + ) } #[deprecated(