From 6fae5a078b43466ea6f2ecd47e521744dff8e384 Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Mon, 9 Dec 2024 14:49:58 -0700 Subject: [PATCH] reinstate down_cast_any_ref (#13705) --- .../physical-expr-common/src/physical_expr.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/datafusion/physical-expr-common/src/physical_expr.rs b/datafusion/physical-expr-common/src/physical_expr.rs index 93bdcdef8ea0..c2e892d63da0 100644 --- a/datafusion/physical-expr-common/src/physical_expr.rs +++ b/datafusion/physical-expr-common/src/physical_expr.rs @@ -214,6 +214,21 @@ pub fn with_new_children_if_necessary( } } +#[deprecated(since = "44.0.0")] +pub fn down_cast_any_ref(any: &dyn Any) -> &dyn Any { + if any.is::>() { + any.downcast_ref::>() + .unwrap() + .as_any() + } else if any.is::>() { + any.downcast_ref::>() + .unwrap() + .as_any() + } else { + any + } +} + /// Returns [`Display`] able a list of [`PhysicalExpr`] /// /// Example output: `[a + 1, b]`